Cleanup

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.

(3)

You rated this post out of 5. Change rating

2019-12-10

2,601 reads

Blogs

SQL Server Journey (Part 1)- Enterprise Database 2016

By

Continued thinking about my Journey blog where we have to look back at the...

Announcements from the Microsoft Fabric Community Conference

By

A ton of new features for Microsoft Fabric were announced at the Microsoft Fabric Community...

PowerShell Remoting for SQL DBAs: WinRM + SSH Guide (Updated 2026)

By

PowerShell Remoting for SQL DBAs: WinRM + SSH Guide (Updated 2026) ...

Read the latest Blogs

Forums

Identities and Sequences II

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Identities and Sequences II

Using PostgreSQL as a NoSQL Store and a Search Engine

By sabyda

Comments posted to this topic are about the item Using PostgreSQL as a NoSQL...

Is Your Time "Free"?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Is Your Time "Free"?

Visit the forum

Question of the Day

Identities and Sequences II

In thinking about the differences between the identity property and a sequence object, which of these two guarantees that there are consecutive numbers (according to the increment) inserted in a single table?

See possible answers