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)

2006-06-08 (first published: )

734 reads

Blogs

What Agent Jobs are Running??

By

Do you run SQL Agent Jobs in your environment?  Do you know what is...

Unboxing SQL Clone 2020 for a PoC

By

When I got a new machine, I had SQL Clone on my old machine,...

Daily Coping 4 Aug 2020

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Read the latest Blogs

Forums

Recursive Select runs slow

By Soleya

Hello, I have a recursive Select that runs ultra slow. My test table has...

Collation Japanese table to Latin Collated table

By Jonathan Marshall

Hello, Working on a project where there are tables that have Japanese characters using...

Operating system error 1117 (I/O device error)

By Anderso

Hi, I have 3 Hyper-V servers in  a cluster with a SQL2019 VM on...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers