摘要:
declare tb cursor local forselect 'sp_changeobjectowner ''['+replace(user_name(uid),']',']]')+'].['+replace(name,']',']]')+']'',''dbo'''from sysobjects where xtype in('U','V','P','TR','FN','IF','TF') ... 阅读全文
posted @ 2009-10-12 15:40
敬YES
阅读(373)
评论(0)
推荐(0)
摘要:
使用游标逐个清空表declare tempCursor cursor forselect name from sysobjects where type='U'--获取数据库中所有表名:‘U’表示用户表open tempCursordeclare @tbName varchar(50)fetch next from tempCursorinto @tbNamewhile @@fetch_status=0begin exec('truncate table '+ @tbName )fetch next from tempCursorinto @tbNameend close tempCursor 阅读全文
posted @ 2009-10-12 15:38
敬YES
阅读(2171)
评论(3)
推荐(0)
浙公网安备 33010602011771号