Delete Data

Technical Article

T-SQL script to purge all the tables including foreign key references

  • Script

T-SQL script to purge all the tables including foreign key references. The script has been made smart enough to use TRUNCATE wherever there is no foreign key reference and to use DELETE wherever there is foreign key reference.

5 (3)

You rated this post out of 5. Change rating

2019-12-10

2,567 reads

Blogs

Sabbatical 3 Review

By

I’m back. My last day of work was Jun 27 and I came back...

Advice I Like: Naps

By

Learn how to take a 20-minute power nap without embarassment. – from Excellent Advice...

SQL Server Management Studio uses the Visual Studio installer

By

Yes, SSMS 21 uses the Visual Studio installer. No, you don’t need to download...

Read the latest Blogs

Forums

The Next Great Thing

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Next Great Thing

Building a Database Dashboard with SSRS

By Nisarg Upadhyay

Comments posted to this topic are about the item Building a Database Dashboard with...

Enabling Change Tracking

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Enabling Change Tracking

Visit the forum

Question of the Day

Enabling Change Tracking

If I want to set up Change Tracking in a database, what should I do first in SQL Server 2022?

See possible answers