declare @sqlcmd varchar(4000)
set @sqlcmd = ''
select @sqlcmd = @sqlcmd + 'delete from ' + name + char(10) from sysobjects where type = 'U'
--exec (@sqlcmd)
print @sqlcmd
--or use 'truncate table ' command
转载于:https://www.cnblogs.com/abenmao/archive/2012/05/16/2504322.html