Go

WHILE (select count(table_name) from INFORMATION_SCHEMA.TABLES  where table_name NOT LIKE 'BIN%')>0
BEGIN
   DECLARE @table_name varchar(max)

   SET @table_name =(SELECT TOP 1 table_name from INFORMATION_SCHEMA.TABLES where table_name NOT LIKE 'BIN%')

   exec ('drop table ' +@table_name) 

END;


DROP SEQUENCE pramhist_seq;


