Need a way to delete all tables at one time ?
No command or existing function yet out there.
But you can run below to delete all tables at one time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @sql NVARCHAR(max)='' | |
SELECT @sql += ' Drop table ' + QUOTENAME(TABLE_SCHEMA) + '.'+ QUOTENAME(TABLE_NAME) + '; ' | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_NAME like 'et_ticket%' | |
Exec Sp_executesql @sql |
No comments:
Post a Comment