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

Multilayer CSV to filtered excel -

Listboxes in c# -

ios - Why must I define variables twice in the Header file? -