purgingtable

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,235 reads

Blogs

Common Mistakes in SQL Server – Part 2

By

The  Identity property creates an incremental value for the specified column automatically, which is...

Enable PowerShell Remoting

By

Enable PowerShell Remoting I use PowerShell quite a lot...

Get Configuration Change History From the SQL Server Error Logs

By

Get Configuration Change History From the SQL Server Error Logs There...

Read the latest Blogs

Forums

Restore With Standby; A Review and A Lesson Learned

By Andy Warren

Comments posted to this topic are about the item Restore With Standby; A Review...

Are You Worried About AI?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Are You Worried About AI?

The Upgraded Procedure part 2

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Upgraded Procedure part 2

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers