1
位值,假设我有一个表,这样约束在TSQL
[StockBarcodeID] [uniqueidentifier] NOT NULL,
[UserID] [uniqueidentifier] NOT NULL,
[StockID] [uniqueidentifier] NOT NULL,
[UnitPrice] [money] NOT NULL,
[Barcode] [varchar](16) NOT NULL,
[IsDefault] [bit] NOT NULL,
[LastUpdated] [datetime] NOT NULL,
一个如何去创造一个限制,允许每stockid只有1个默认条码行?
我似乎无法摆脱这个问题。这是一个唯一的约束或检查约束?
可能重复的[T-SQL唯一约束WHERE AnotherColumn = ParticularValue](http://stackoverflow.com/questions/4097484/t-sql-unique-constraint-where-anothercolumn-particularvalue)(还有在这个问题上的进一步链接到其他*类似的问题) – 2010-11-18 07:15:49
可能的重复[约束只有一个记录被标记为默认值。](http://stackoverflow.com/questions/637894/constraint-for-only-一个记录标记为默认) – InSane 2010-11-18 07:21:54
我很抱歉,因为看起来你是正确的,这是其他问题的重复。问题是每个人都有自己的方式来表达问题,因此重复着...如果你想关闭,请随意。再次抱歉 :-) – 2010-11-19 04:23:16