T-SQL

External Article

Do You Have REFERENCES?

  • Article

The logic for referential integrity can be implemented in application code, but to make sure that it is enforced, include foreign key constraints in the database design instead. In this article, Joe Celko talks about the history of references in SQL and the options available today.

2019-12-27

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.

(3)

You rated this post out of 5. Change rating

2019-12-10

2,598 reads

Technical Article

Function and Queries to Convert Hierarchical Adjacency to Nested Json Arrays

  • Script

This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node.  The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression. 

You rated this post out of 5. Change rating

2019-11-25 (first published: )

781 reads

Blogs

Webinar: Navigating the Database Landscape in 2026

By

For a number of years, we’ve produced the State of the Database Landscape report,...

Claude AI Convinced Me Not to Build an iPad App

By

I coach volleyball and I do a lot of stat stuff on paper. I...

A New Word: Dolorblindness

By

dolorblindness – n. the frustration that you’ll never be able to understand another person’s...

Read the latest Blogs

Forums

The Power of Data and Privacy

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Power of Data and...

What's the Date?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item What's the Date?

Two New Shortcuts for Fabric Lakehouse Developers: The Fabric Modern Data Platform

By John Miner

Comments posted to this topic are about the item Two New Shortcuts for Fabric...

Visit the forum

Question of the Day

What's the Date?

In SQL Server 2025, there is a new function that returns the current date without the time. What is it?

See possible answers