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,592 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: )

779 reads

Blogs

2025 Wrapped for Steve

By

I’ve often done some analysis of my year in different ways. Last year I...

The Book of Redgate: Spread across the world

By

This was Redgate in 2010, spread across the globe. First the EU/US Here’s Asia...

Merry Christmas

By

Today is Christmas and while I do not expect anybody to actual be reading...

Read the latest Blogs

Forums

Finding Motivation

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Finding Motivation

The Last Binary Value of the Year

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Last Binary Value of...

SQL Art, Part 2: New Year Fireworks in SSMS

By tedo

Comments posted to this topic are about the item SQL Art, Part 2: New...

Visit the forum

Question of the Day

The Last Binary Value of the Year

What does this code return?

SELECT cast(0x2025 AS NVARCHAR(20))
Image 1: Image 2: Image 3: Image 4:

See possible answers