Delete all rows from all tables in a SQL Server Database

274
Delete all rows from all tables

Delete all rows from all tables SQL server

Have you ever come across the problem to delete all rows from all tables available in a database? One of my colleagues asked me this question that how can we delete all records from multiple tables of a database. So, in this SQL tutorial, we are going to discuss, how we can delete all rows from all tables of a SQL Server database.

Follow below steps with t-SQL delete all records from all tables from SQL server:

  • Disable all constraints first:-
  • Execute a Delete or truncate operation on each table of the database:-
  • Enable all constraints on the database:-

sql query to delete all rows from all tables

Did you find this post useful? I hope you liked this article. Please share with me your valuable suggestions and feedback.

LEAVE A REPLY

Please enter your comment!
Please enter your name here