declare @tabname varchar(50)
declare tables CURSOR FOR SELECT [name] FROM sysobjects where [name] LIKE ‘%’ + @BackupNo AND type=’U’
OPEN tables
FETCH NEXT FROM tables INTO @tabname
WHILE @@FETCH_STATUS = 0
BEGIN
exec (‘drop table
‘+@tabname
)
FETCH NEXT FROM tables INTO @tabname
END
CLOSE tables
DEALLOCATE tables