Dec 31, 2013

Sql query for DELETE all the records or rows of all the tables in database in sql server


Sql query for DELETE all the records or rows of all the tables in database in sql server

We can delete all the records or rows of all tables of sql of given database using system stored procedure sp_MSforeachtable. For example:

EXECUTE sp_MSforeachtable N'SELECT * FROM ?'

If you have any quires you can ask here.

No comments:

Post a Comment