Wednesday, February 7, 2007

MS SQL server: Truncate All Tables


use my_db
-- check the table names first
exec sp_msforeachtable 'print ''?'''
-- uncomment the next line to truncate
--exec sp_msforeachtable 'truncate table ?'

No comments: