Groups | Blog | Home
all groups > sql server new users > june 2006 >

sql server new users : add unique constraint to varchar field


Arnie Rowland
6/30/2006 2:28:12 PM
Something like this:


ALTER TABLE MyTable
ADD CONSTRAINT c_ColumnName_unq Unique (ColumnName)

--
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."

*Yet Another Certification Exam


[quoted text, click to view]

Daves
6/30/2006 7:53:47 PM
that's it - I have a varchar(10) field (not null) which I need to add an
UNIQUE constraint to but I don't know how to?

AddThis Social Bookmark Button