亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

MSSQL 刪除數(shù)據(jù)庫里某個用戶所有表里的數(shù)據(jù)

 更新時間:2009年09月21日 18:14:08   作者:  
刪除數(shù)據(jù)庫里某個用戶所有表里的數(shù)據(jù)的實現(xiàn)語句。
-->Title:刪除數(shù)據(jù)庫里某個用戶所有表里的數(shù)據(jù)
-->Author:wufeng4552
-->Date :2009-09-21 15:08:41
--方法1
復制代碼 代碼如下:

declare @uname varchar(20)
declare cuser cursor for
select so.name
from sysobjects so,sysusers su where so.uid=su.uid and su.name='Stone'
and so.xtype='U'
open cuser
fetch next from cuser into @uname
while(@@fetch_status=0)
begin
exec('truncate table [Stone].['+@uname+']')
fetch next from cuser
end
close cuser
deallocate cuser

--方法2
復制代碼 代碼如下:

exec sp_msforeachtable @command1="truncate table ? ;",@whereand='and schema_id = (select schema_id from sys.schemas where [name] =''Stone'')'

相關(guān)文章

最新評論