Brahmanand Shukla

T-SQL script to purge all the tables including foreign key references

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)

2019-11-11 (first published: )

751 reads

Generic trigger for maintaining the Audit Log

This trigger will work even if you don't have the primary key on any table. Mechanism to configure the primary key in config table has been provided. This can be very helpful to solve the system audit requirements without much efforts.

Disclaimer : Audit Log trigger has performance overhead. It’s meant for table which is not frequently updated, deleted or inserted. Please take precaution when creating the trigger on the table having too many columns.

2.33 (3)

2019-10-15 (first published: )

584 reads

Blogs

SQLOrlando 2019

By

We just had our final event of the year and looking back, not bad...

New Power BI Report Design Pre-Con in 2020

By

I’m excited to announce that I will be offering a full-day pre-con about Power...

Read the latest Blogs

Forums

From Source Control to Database using SQL Compare Command Line

By Additional Articles

Comments posted to this topic are about the item From Source Control to Database...

The Schema Name

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Schema Name

The Login Types

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Login Types, which is...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers