在SQL Server上创建约束,防止两个字段同时重复,
//shop为库名;DDHG_ServiceInfo为表名;wxpingzheng, shopcode为防止重复的两个字段;AK_xsdd_shopcode为约束的名字
USE shop;
GO
ALTER TABLE DDHG_ServiceInfo
ADD CONSTRAINT AK_xsdd_shopcode UNIQUE (wxpingzheng, shopcode);
GO
在SQL Server上创建约束,防止两个字段同时重复,
//shop为库名;DDHG_ServiceInfo为表名;wxpingzheng, shopcode为防止重复的两个字段;AK_xsdd_shopcode为约束的名字
USE shop;
GO
ALTER TABLE DDHG_ServiceInfo
ADD CONSTRAINT AK_xsdd_shopcode UNIQUE (wxpingzheng, shopcode);
GO