EXEC sp_MSForEachTable 'TRUNCATE TABLE ?'
You can use this stored procedure to execute any sql code for each table in a database. For example, you could use it to get the row count for each table in the database
EXEC sp_MSForEachTable 'SELECT COUNT(*) as ''?'' FROM ?'
No comments:
Post a Comment