3

I'm new to HeidiSQL and can't seem to find a manual. How can I make a field unique from inside the client? I see this post here describing the SQL statement that I need. Is there a way to do this in the client with a check mark or something? Is it also possible to call a SQL statement from within HeidiSQL that would accomplish my goal?

Community
  • 1
  • 1
mitch
  • 336
  • 1
  • 6
  • 13

1 Answers1

5

Click on the table you want to alter. There is a tab called "Indexes" there. Add a new index. Add the column you want to make unique to this index. Under "Type / Length", select UNIQUE. Then save.

vitorsdcs
  • 672
  • 7
  • 31
  • I made my TINYTEXT field UNIQUE using your suggestion. But upon saving received SQL error 1170 about needing a key length. I tried changing my field to CHAR(100) and that seemed to work ok. Is UNIQUE not appropriate for TINYTEXT fields? – mitch Aug 26 '14 at 14:26