Truncate

Technical Article

Truncate tables with foreign keys

  • Script

Truncating tables with constraints always had been a pain, since we have to drop and recreate all the FKs. I created a script that takes care of dropping and recreating the foreign keys while truncating. Please use with caution! and always respect your Data !

3.67 (3)

You rated this post out of 5. Change rating

2016-12-01 (first published: )

1,328 reads

Blogs

SQL Server Source Control on a $0 Budget

By

The Source Control Dilemma Every DBA has been there. Trying to keep track of...

CHOOSE’ing a Beer: #SQLNewBlogger

By

We recently published an article on CHOOSE at SQL Server Central. I thought it...

Don’t Treat Your Data Catalog Like a Data Museum

By

Introduction Treating your data catalog like a “data museum”—a static collection where information quietly...

Read the latest Blogs

Forums

The Inefficiencies of Kubernetes

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Inefficiencies of Kubernetes

The Backup Space Needed

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Backup Space Needed

Implementing Fuzzy Search in SQL Server Using New Inbuilt Functions

By utsav

Comments posted to this topic are about the item Implementing Fuzzy Search in SQL...

Visit the forum

Question of the Day

The Backup Space Needed

How do I calculate the amount of space needed for I/O buffers during a backup operation?

See possible answers