MSSQL 2005删除所有表的语句[转]
2011-01-01 09:42
218 查看
go
declare @tbname varchar(250)
declare #tb cursor for select name from sysobjects where objectproperty(id,'IsUserTable')=1
open #tb
fetch next from #tb into @tbname
while @@fetch_status=0
begin
exec('drop table ['+@tbname+']')
fetch next from #tb into @tbname
end
close #tb
deallocate #tb
declare @tbname varchar(250)
declare #tb cursor for select name from sysobjects where objectproperty(id,'IsUserTable')=1
open #tb
fetch next from #tb into @tbname
while @@fetch_status=0
begin
exec('drop table ['+@tbname+']')
fetch next from #tb into @tbname
end
close #tb
deallocate #tb
相关文章推荐
- MSSQL 2005删除所有表的语句[转]
- SQL SERVER 2005 获取表的所有索引信息以及删除和新建语句
- SQL SERVER 2005 获取表的所有索引信息以及删除和新建语句
- SQL SERVER 2005 获取表的所有索引信息以及删除和新建语句
- MSSQL2005 查找索引,和删除表的所有索引
- SQL SERVER 2005 获取表的所有索引信息以及删除和新建语句
- 删除数据库所有存储过程的SQL语句
- 一次性删除数据库所有表和所有存储过程 SQL语句
- sql server 2005 压缩实例下所有数据库文件及日志文件 语句【转】
- 生成删除某个数据库中的所有表外键关联语句
- sqlserver 批量删除所有表语句
- MSSQL2005取得阻塞的SQL语句
- 编写一个删除C语言源程序中的所有注释语句,要正确处理带引号的字符串和字符常量。
- 一个查看MSSQL数据库中所有表信息的SQL语句
- MSSQL 如何删除字段的所有约束和索引
- 查询与删除MSSQL中所有外键约束
- SQL语句删除所有表
- 一次删除所有表的SQL语句
- 删除指定表的所有索引,包括主键索引,唯一索引和普通索引 ,适用于sql server 2005,
- SQL批量删除语句,SQL删除所有数据