批量刪除語句
發布時間:2024/8/5 16:46:38 作者:Admin 閱讀:39
廣告:
DECLARE @tableName NVARCHAR(255)
DECLARE tableCursor CURSOR FOR
select ISBN from num
OPEN tableCursor
FETCH NEXT FROM tableCursor INTO @tableName
WHILE @@FETCH_STATUS = 0
BEGIN
--PRINT @tableName
--exec('dbcc checktable('+@TableName+',repair_allow_data_loss)')
--select * from test where book like '%'+@tableName+'%'
delete from test where book like '%'+@tableName+'%'
FETCH NEXT FROM tableCursor INTO @tableName
END
CLOSE tableCursor
DEALLOCATE tableCursor
廣告:
相關文章