Technical Article

Truncate all tables in a database

,

This "script" truncates all user tables in a database (except dtproperties).  It uses sp_msforeachtable stored procedure which cycles through each table in the database and performs the same query on each. Its useful in a number of different scenarios

sp_msforeachtable 'TRUNCATE TABLE ?'

Rate

1 (1)

You rated this post out of 5. Change rating

Share

Share

Rate

1 (1)

You rated this post out of 5. Change rating