可以生成表的腳本,打開,然后找到create,刪除這個位置以后的腳本,運行即可!

解决方案 »

  1.   

    select name from sysobjects where xtype='u'
     使用一个游标,循环删除..
      

  2.   

    declare @a varchar(50)
    declare  a cursor for
    select name from sysobjects where xtype='U'
    open a
    fetch next from a into @a
    while @@fetch_status=0
    begin
    exec('drop table '+@a+'')
    fetch next from a into @a
    end
    close a
    deallocate a
      

  3.   

    exec sp_MsForEachTable 'drop ?'