Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用删除数据库中的所有表名
EXEC sp_MSforeachtable 'DROP TABLE ?'
有没有办法我可以计算丢弃的表数。
谢谢,秘鲁
DECLARE @before int; SELECT @before = COUNT(*) FROM sys.tables; EXEC sp_MSforeachtable 'DROP TABLE ?' SELECT @before - COUNT(*) FROM sys.tables