Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 drop tables

Author  Topic 

pnpsql
Posting Yak Master

246 Posts

Posted - 2011-11-24 : 22:54:59
hi team,

i need to drop all tables name like 'event_ch_%'
that tables are created when we execute some procs in our database
and are not temp tables. how can i drop this.
please suggest.

challenge everything

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-11-25 : 00:14:22
one shortcut is run this and copy & paste the result into another query window and execute

select 'DROP TABLE ' + quotename([name])
from sys.tables
where [name] like 'event_ch_%'


Do make sure those are the unwatend tables before execute it.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

pnpsql
Posting Yak Master

246 Posts

Posted - 2011-11-25 : 00:42:40
thanks.i also need to free up the disk space after table drop.

challenge everything
Go to Top of Page
   

- Advertisement -