T-SQL

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.

5 (3)

You rated this post out of 5. Change rating

2019-12-10

2,388 reads

SQLServerCentral Article

SQL Server Name Convention and T-SQL Programming Style

  • Article

There are only two hard things in Computer Science: cache invalidation and naming things -- Phil Karlton The recommendations in this article are not the ultimate truth. Please consider this article as a rule template that you can adapt to your needs. A naming convention is a set of rules for choosing the character sequence to […]

4.7 (10)

You rated this post out of 5. Change rating

2019-12-10

23,214 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: )

698 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-12 (first published: )

1,936 reads

SQLServerCentral Article

Some T-SQL INSERTs DO Follow the Fill Factor! (SQL Oolie)

  • Article

With origins from the world of “Submarine ‘Dolphin’ Qualification” questions, an “Oolie” is a difficult question to answer, or the knowledge or fact needed to answer such a question, that may or may not pertain to one's duties but tests one's knowledge of a system or process to the limit. Introduction Contrary to what many […]

5 (9)

You rated this post out of 5. Change rating

2019-08-08

6,097 reads

Blogs

Use a slicer to filter a visual based upon a measure in Power BI

By

Have you ever wanted to filter a visual by selecting a range of values...

Deleting Stale Local Database Git Branches with SSMS–#SQLNewBlogger

By

I wrote a post recently about pruning branches in git. That’s part of the...

Microsoft Fabric shortcuts

By

I talked about Microsoft Fabric shortcuts in my blog post Microsoft Fabric – the...

Read the latest Blogs

Forums

Blocking question

By SQL Guy 1

Hi all, We have a SSIS package that does 2 things in parallel: moves...

can I monitor auto stats updates through extended events?

By Eric Mamet

We have pretty big tables very sensitive to stats with many updates. Our systems...

SSIS upgrade

By Sailor

I have about 40 packages that are dtsx files that were created with SQL...

Visit the forum

Question of the Day

Post Restore Tasks for the Resource Database

I backup the Resource database from my SQL Server 2022 instance. I then install CUs 1, 2, 3, and 4. I have an issue and need to restore my Resource database from backup. Is there anything I need to do after restoring this database?

See possible answers