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)

You rated this post out of 5. Change rating

2006-06-08 (first published: )

748 reads

Blogs

Advice I Like: Pyramid Schemes

By

If someone is trying to convince you it’s not a pyramid scheme, it’s a...

Using Prompt AI for a Travel Data Analysis

By

I was looking back at my year and decided to see if SQL Prompt...

FinOps for Kubernetes: Leveraging OpenCost, KubeGreen, and Kubecost for Cost Efficiency

By

In the era of cloud-native applications, Kubernetes has become the default standard platform for...

Read the latest Blogs

Forums

Database file shrink issue.

By Tac11

Hi experts, I have a 3+ TB database on a 2019 sql server which...

The North Star for the Year

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The North Star for the...

Multiple Escape Characters

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Multiple Escape Characters

Visit the forum

Question of the Day

Multiple Escape Characters

In SQL Server 2025, I run this code (in a database with the appropriate collation):

SELECT UNISTR('%*3041%*308A%*304C%*3068 and good night', '%*') AS 'A Classic';
What is returned?

See possible answers