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

Blogs

Friday Flyway Tips: State-based deployment with Flyway Teams

By

I was asked about state-based deployments in Flyway Teams, so I decided to show...

Advice I Like: The Main Thing

By

The main thing is to keep the main thing the main thing. – from...

Sic Transit Gloria Community

By

When Covid took out the PASS organization, I had someone say to me, “Well,...

Read the latest Blogs

Forums

Dynamic T-SQL Script Parameterization Using Python

By omu

Comments posted to this topic are about the item Dynamic T-SQL Script Parameterization Using...

ExecutionLog3 table in Reportserver Database

By cooldude001

I have a SSRS report for which users are complaining to be slow, but...

SQL Server Maintenance Plan Feedback

By water490

Hi I set this up today.  I wanted to get some feedback.  I have...

Visit the forum

Question of the Day

Counting Bits IV

What do these two selects return?

SELECT BIT_COUNT (CAST (-1 as smallint))
     , BIT_COUNT (CAST (-1 as bigint))

See possible answers