USE Yolo880_Hotel ; GO -- Find an existing index named AK_UnitMeasure_Name -- on the Production.UnitMeasure table and delete it if found. IF EXISTS (SELECT name from sys.indexes WHERE name = N'IX_F_GoodsName' AND object_id = OBJECT_ID(N'T_IOS_Goods', N'U')) DROP INDEX IX_F_GoodsName ON T_IOS_Goods; GO -- Create a unique index called AK_UnitMeasure_Name -- on the Production.UnitMeasure table using the Name column. CREATE UNIQUE INDEX IX_F_GoodsName ON T_IOS_Goods(F_GoodsName); GO USE Yolo880_Hotel ; GO -- Find an existing index named AK_UnitMeasure_Name -- on the Production.UnitMeasure table and delete it if found. IF EXISTS (SELECT name from sys.indexes WHERE name = N'IX_F_NumberSpell' AND object_id = OBJECT_ID(N'T_IOS_Goods', N'U')) DROP INDEX IX_F_NumberSpell ON T_IOS_Goods; GO -- Create a unique index called AK_UnitMeasure_Name -- on the Production.UnitMeasure table using the Name column. CREATE UNIQUE INDEX IX_F_NumberSpell ON T_IOS_Goods(F_NumberSpell); GO
建议在客户初始化安装的时候就运行此语句