Subscribe to Feed

14May

how to Delete Data From All Tables in SQl Server?

Posted by admin as Asp.Net, SQL

 

You should be able to Delete data from all tables in a SQL server database by running the following TSQL command.

EXEC sp_MSforeachtable @command1 = 'DELETE FROM ?'

Note: You might see some errors if there are foreign key constraints in your database. Just keep executing the above command until you see no errors and you should be good to go with a clean database.

Comment Form