How can I create a SQL unique constraint based on 2 columns?

前端 未结 5 1426
心在旅途
心在旅途 2020-12-08 01:45

I have a Table like this one:

|UserId   |  ContactID |  ContactName 
---------------------------------------
| 12456   |  Ax759     |  Joe Smith
| 12456   |          


        
5条回答
  •  醉话见心
    2020-12-08 02:30

    You can try ALTER TABLE [TABLE_NAME] ADD UNIQUE (column1,column2,column3 ...columnN).

    Hope this helps cheers.

提交回复
热议问题