Truncate All Tables In Database Using sp_MSforeachtable

Shiva

1 line script to truncate (delete all rows without logging the transactions) all tables within a SQL Server database.
[code='sql']
exec sp_MSforeachtable "truncate table ? PRINT'? truncated '"
[/code]

Leave a Reply

Advertise Here

Photos from our Flickr stream

See all photos

Advertise Here