enter image description hereAm 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

有帮助吗?

解决方案

DECLARE @before int;

SELECT @before = COUNT(*) FROM sys.tables;
EXEC sp_MSforeachtable 'DROP TABLE ?'
SELECT @before - COUNT(*) FROM sys.tables
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top