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

Monday Monitor Tips: Finding the Hostname for Queries

By

I was chatting with a customer recently and they wanted to know which host...

Can AI Read Execution Plans?

By

Yeah, yeah, second AI post in a row. I promise not to make a...

Streamline Dependency Management in Databases

By

In the intricate world of business, where precision and efficiency are paramount, managing database...

Read the latest Blogs

Forums

SSIS Won't Create Log Entries

By water490

Hi everyone My SSIS package will not log to sysssislog.  I am not sure...

SQL Server is terminating in response to a 'stop' request from Service error

By naga.rohitkumar

Dear All, In one of the server its repeatedly restarting sqlserver services and not...

Understanding CROSS APPLY and OUTER APPLY in SQL Server

By Noman072

Comments posted to this topic are about the item Understanding CROSS APPLY and OUTER...

Visit the forum

Question of the Day

Database Files on Shares I

I want to store database files on a file share for a SQL Server 2017 instance. Can I use \\fileserver\D$ as a location?

See possible answers