MSSQL 2005删除所有表的语句[转]
2010-01-27 11:23
281 查看
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 获取表的所有索引信息以及删除和新建语句
- MSSQL2005 查找索引,和删除表的所有索引
- SQL SERVER 2005 获取表的所有索引信息以及删除和新建语句
- SQL SERVER 2005 获取表的所有索引信息以及删除和新建语句
- SQL SERVER 2005 获取表的所有索引信息以及删除和新建语句
- SQL语句添加删除修改字段[sql server 2000/2005]
- MSSQL如何删除字段的所有约束和索引
- 一次性删除数据库所有表和所有存储过程 SQL语句
- MSSQL中删除与修改列的SQL语句
- 生成删除某个数据库中的所有表外键关联语句
- 【1-23】编写一个删除C语言程序中所有的注释语句。要正确处理带引号的字符串与字符常量。再c语言中,注释不允许嵌套。
- SQL Serverl删除数据库中所有表与数据语句
- MSSQL_删除所有自建表_存储过程
- SQLServer 2005 列所有存储过程的语句
- 一下删除MSSQL表所有的数据,但不删除表结构
- 一个查看MSSQL数据库中所有表信息的SQL语句
- SqlServer删除所有存储过程和所有表、查询表是否存在指定的记录及UPDATE语句
- sql删除数据库中的所有表语句
- 编写一个删除C语言源程序中的所有注释语句,要正确处理带引号的字符串和字符常量。