Truncate All Tables in sql server database
USE [DatabaseName]
EXEC sp_MSforeachtable 'TRUNCATE TABLE ?' In case you are not able to TRUNCATE due to foreign keys etc. you can run the same as a delete:
USE [DatabaseName]
EXEC sp_MSforeachtable 'DELETE FROM ?'
Comments
Post a Comment