【发布时间】:2014-03-31 18:35:35
【问题描述】:
试图更改 SQL Server 中的表。我想为表ReportingItemNames 中名为Names 的列添加唯一约束:
ALTER TABLE ReportingItemNames
ADD CONSTRAINT UC_ReportingItemNames$Name UNIQUE ([ReportingItemNames,Name])
但我收到此错误:
目标表或视图中不存在列名“ReportingItemNames,Name”
我哪里出错了?
【问题讨论】:
-
只使用unique之后的列名。
标签: sql constraints alter