Wednesday 15 June 2011

how to make two 3 columns are unique in SQL server ? -


I want to make three columns unique in my data table

  ----- ------------------------------ Column A | Column B | Column C ---------------------------------------------------------------------------------- ----------------------- Kasun Cham Rox - This line is fine and should be allowed to add. ------------------------------------------------------------------------------------------------------------------------------------------ Should --------------------------------   

How do I do this in SQL Can I do the server?

This code will do what you want.

  Create a table on the table named Cluster Index index_name (call1, cola2, col3) or unique unusual index index name (call1, cola2, coal3) or alter table [dbo ]. [Table] ADD CONTRACT UNIQUE_Table UNIQUE_Table UNIQUE CLUSTERED (col1, col2, col3) ON [Primary]    

No comments:

Post a Comment