sql - drop the bulk table from database -


i want drop bulk table database name starts string.

create table #temp ( tablename varchar(50) )

insert #temp select name sys.objects type='u' name '%'

declare @name varchar(50)

declare cursorname cursor -- declare cursor

local scroll static

for

select tablename temp

open cursorname -- open cursor

fetch next cursorname

into @name

while @@fetch_status = 0

begin

fetch next cursorname

into @name

drop table @name

end

close cursorname -- close cursor

deallocate cursorname -- deallocate cursor

note : work if table u talking abt doesnt have table depedencies .


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -