Test event

When a UNIQUE constraint is added to an existing column or columns in the table, by default, the Database Engine examines the existing data in the columns to make sure all values are unique. If a UNIQUE constraint is added to a column that has duplicated values, the Database Engine returns an error and does not add the constraint.

The Database Engine automatically creates a UNIQUE index to enforce the uniqueness requirement of the UNIQUE constraint. Therefore, if an attempt to insert a duplicate row is made, the Database Engine returns an error message that states the UNIQUE constraint has been violated and does not add the row to the table. Unless a clustered index is explicitly specified, a unique, nonclustered index is created by default to enforce the UNIQUE constraint.

The following excerpt of a CREATE TABLE statement shows the definition of the Name column, specifying a UNIQUE constraint on this column to make sure the values are unique.

Name nvarchar(100) NOT NULL


To remove the uniqueness requirement for values entered in the column or combination of columns included in the constraint, delete a UNIQUE constraint. You cannot delete a UNIQUE constraint if the associated column is used as the full-text key of the table.

To create a UNIQUE constraint when you create a table

  • CREATE TABLE (Transact-SQL)

To create a UNIQUE constraint on an existing table

  • ALTER TABLE (Transact-SQL)

To delete a UNIQUE constraint

  • ALTER TABLE (Transact-SQL)

To obtain information about UNIQUE constraints

  • sys.key_constraints (Transact-SQL)


UNIQUE Constraints

Help and Information

Getting SQL Server 2008 Assistance

Name Sales End Price Fee
Sample Ticket Ended $5 $0.99

On the Web

Unit testing that an event is raised in C# - Stack Overflow

I have some code that raises PropertyChanged events and I would like to be able to unit test that the events are being raised correctly. The code that is raising the ...


Test Event-Do Not Purchase Tickets | Test Event-Do Not ...

Buy Test Event-Do Not Purchase tickets from the official Ticketmaster.com site. Find Test Event-Do Not Purchase tour schedule, concert details, reviews and photos.


Test Event - YouTube

Test Event - YouTube ... Testing Testing


Events | ISAF | World Sailing | Official Website : Aquece ...

The Aquece Rio - International Sailing Regatta 2014 is the first test event of the Rio 2016 Olympic and Paralympic Games and will take place from 2-9 August from the ...


Test Events | Toronto 2015 Pan Am / Parapan American Games

Can’t wait until the TORONTO 2015 Games to see top athletes in action? Eager to check out the spectator experience in our brand-new venues or check out Games-time ...


Test Event - Eventsbot

This web page was published using www.eventsbot.com – Online Event Registration and Management Service. If you have any issues/queries related to this event then ...


Olympics in Rio Golf Course Test Event Scheduled for ...

According to a “draft test event calendar” for the ’16 Games, golf’s test event will be played on Aug. 15, 2015, but there were no further details on what ...