删除数据库中所有表,存储过程
作者:互联网
use 数据库名称
declare @tname varchar(8000)
set @tname=''
select @tname=@tname + Name + ',' from sysobjects where xtype='U'
select @tname='drop table ' + left(@tname,len(@tname)-1)
print @tname
exec(@tname)
go
use 数据库名称
declare @tname varchar(8000)
set @tname=''
select @tname=@tname + Name + ',' from sysobjects where xtype='P'
select @tname='drop Procedure ' + left(@tname,len(@tname)-1)
print @tname
exec(@tname)
go
标签:存储,set,xtype,删除,tnameexec,数据库,tname,select 来源: https://www.cnblogs.com/xiaoan-one/p/10973497.html