1.判断索引是否存在
ps:@tableName 表名称, @indexName 索引名
IF EXISTS (SELECT 1 FROM sys.indexes WHERE object_id=OBJECT_ID(@tableName, N'U') and NAME=@indexName)
BEGIN
DROP INDEX @indexName ON @tableName
END
2.判断表名称是否存在
ps:后期更新
2023-01-07 19:39:00
1.判断索引是否存在
ps:@tableName 表名称, @indexName 索引名
IF EXISTS (SELECT 1 FROM sys.indexes WHERE object_id=OBJECT_ID(@tableName, N'U') and NAME=@indexName)
BEGIN
DROP INDEX @indexName ON @tableName
END
2.判断表名称是否存在
ps:后期更新