像这样向现有表添加约束
ALTER TABLE Customers ADD CONSTRAINT Con_First check
(
CustomerType = 'Business' AND BusinessName IS NOT NULL AND BusinessType IS NOT NULL
OR CustomerType <> 'Business' -- BusinessName and BusinessType can be null or not null, we omit AND here
)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句