DECLARE @before int;
SELECT @before = COUNT(*) FROM sys.tables;
EXEC sp_MSforeachtable 'DROP TABLE ?'
SELECT @before - COUNT(*) FROM sys.tables
Count of DROP Statements Executed for sp_MSforeachtable
-
02-04-2022 - |
Frage
Am dropping all the table names in DB using
EXEC sp_MSforeachtable 'DROP TABLE ?'
Is there a way i can get count on number of tables dropped.
Thanks, Peru
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow