【发布时间】:2018-08-30 10:23:06
【问题描述】:
我试过了,但没用
ALTER Procedure [dbo].[SP_TruncateDTS] as
begin
declare @Table Varchar(200)
declare cur1 cursor for
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME like '%DTS%' and TABLE_TYPE = 'BASE TABLE'
open cur1
fetch next from cur1 into @Table
while @@FETCH_STATUS <> -1
begin
TRUNCATE TABLE @Table
fetch next from cur1 into @Table
end
close cur1
deallocate cur1
end
【问题讨论】:
-
dbms 名称好吗?
标签: sql-server tsql cursor truncate