/* 判断索引是否存在,不存在则创建 */ IF EXISTS(select 1 from sysindexes where id=object_id('Base_ProductInfo') and name='ProductInfo_idx_code') DROP INDEX ProductInfo_idx_code ON Base_ProductInfo CREATE INDEX ProductInfo_idx_code ON Base_ProductInfo(ProductCode) GO /* 判断唯一索引是否存在,不存在则创建唯一索引 ,标签打印表 【EditBy shaocx,2022-10-20】*/ IF EXISTS(select 1 from sysindexes where id=object_id('Base_PositionPrint') and name='barCode_idx') DROP INDEX barCode_idx ON Base_PositionPrint CREATE UNIQUE INDEX barCode_idx ON Base_PositionPrint(ExtendField06) GO