declare cursor1 cursor for select name from sysobjects where xtype='u' and name like 'a%'
declare
@i varchar(1000)
open cursor1
fetch cursor1 into @i
while @@fetch_status=0
begin
exec('drop table '+@i)
fetch cursor1 into @i
end
close cursor1
deallocate cursor1
declare
@i varchar(1000)
open cursor1
fetch cursor1 into @i
while @@fetch_status=0
begin
exec('drop table '+@i)
fetch cursor1 into @i
end
close cursor1
deallocate cursor1
解决方案 »
- 游标在当前记录时怎样取下一条记录值
- 请问from table1 inner join table2 和 from table1,table2 的区别?
- SQL数据库用户权限分配的问题
- 请教在数据库里保存二进制数据的问题。谢谢指教。
- 如何能无脑导入目标数据库的内容?(高分!!!!!!!!!!!)
- 关于数据库基本的问题
- 数据库设计(海量数据性能)
- 怎样通过VB调用SQL SERVER 中设好的LOCAL PACKAGES?
- 有一个公司,有两个异地的部门,两个部门共用其中一个部门的SQL2000。请问如何解决?
- 数据库比较问题!!
- 求一条sql语句-连接查询
- 高手值点,一个很简单的事务处理?在线,,,
只能用游标