Technical Article

Generate Add Foreign Keys statements for the table

I was going through the painfull optimization of the database of creating better clustered indexes (not the default ones on the primary key).This operation was requiring removing all foreign keys to this table and then recreation them again.I created this script to optimize this quite tidious task.

1 (1)

You rated this post out of 5. Change rating

2006-06-08 (first published: )

746 reads

Blogs

The End of Year Vacation Burn

By

It’s been a good year for me. With my sabbatical, I felt like I’ve...

Speaking at PASS Summit 2025

By

In less than one month, I will be speaking not once but twice at...

Scooby Dooing Episode 9: The Case of the Artificially Intelligent Villain

By

Welcome back, my fellow sleuths, to my mystery-inspired blog series! I’m having a ton...

Read the latest Blogs

Forums

Create an HTML Report on the Status of SQL Server Agent Jobs

By Nisarg Upadhyay

Comments posted to this topic are about the item Create an HTML Report on...

Powershell script to generate SQL server Inventory in CSV format

By Srinivas Merugu

Comments posted to this topic are about the item Powershell script to generate SQL...

Database Ledger in SQL Server 2022

By Deepam Ghosh

Comments posted to this topic are about the item Database Ledger in SQL Server...

Visit the forum

Question of the Day

Azure SQL Database MAXDOP

When Azure SQL Database was originally released, the MAXDOP was set to 0 for each new database. In Oct 2025, what is the default value for Azure SQL databases?

See possible answers