試圖更改SQL Server中的表。我想唯一的約束表ReportingItemNames
添加到一個名爲Names
柱:SQL - 添加唯一約束失敗
ALTER TABLE ReportingItemNames
ADD CONSTRAINT UC_ReportingItemNames$Name UNIQUE ([ReportingItemNames,Name])
但我收到此錯誤:
Column name 'ReportingItemNames,Name' does not exist in the target table or view
我要去哪裏錯了?
使用唯一後的列名稱。 – Mihai