/*
功能:删除当前数据库有用户表数据
设计:OK_008
时间:2006-05
备注:该脚本执行危险性为★★★★★,不要随意执行
*/
1: DECLARE @tablename varchar(50)
2: DECLARE @truncatesql varchar(255)
3: DECLARE TrCun_Cursor CURSOR FOR
4: select [name] from sysobjects where type = 'U'
5: OPEN TrCun_Cursor
6: FETCH TrCun_Cursor INTO @tablename
7: WHILE(@@fetch_status = 0)
8: BEGIN
9: SET @truncatesql = 'truncate table ' + @tablename
10: -exec(@truncatesql) --当?要?删?除?时?,?就?去?掉?--
11: PRINT @truncatesql
12: FETCH TrCun_Cursor INTO @tablename
13: END
14: CLOSE TrCun_Cursor
15: DEALLOCATE TrCun_Cursor
16: