/*The table names are logged in the table SQLAdmin_Monitor_tbl_size_info
Using cursor to loop thorough the table and dropping them.*/
DECLARE @TableName VARCHAR(100)
DECLARE @dropCommand VARCHAR(255)
DECLARE
FOR
OPEN tableCursor
FETCH next FROM tableCursor INTO @TableName
WHILE (@@Fetch_Status >= 0)
BEGIN
SET @dropCommand = N'DROP TABLE ' +@TableName
EXECUTE(@dropCommand)
FETCH next FROM tableCursor INTO @TableName
End
CLOSE tableCursor
DEALLOCATE tableCursor
No comments:
Post a Comment