Archive

Archive for the ‘SQL’ Category

Adding a UNIQUE constraint

March 5th, 2010 Nizar No comments

I always forget how to do this and then have to spin my wheels searching websites for it. Finally, decided to post it on my blog so I (and others) can quickly get to it:

ALTER TABLE SomeTable
	ADD CONSTRAINT unique_key
	UNIQUE (ColumnOne, ColumnTwo, ...)
Kick It on DotNetKicks.com Shout it