Scripts

Technical Article

Function and Queries to Convert Hierarchical Adjacency to Nested Json Arrays

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

716 reads

Technical Article

Create a view to Alter a Table and Add three Columns

I am teaching a database class at Queens College. The project entails the truncation of all of the data and loading new data into the  existing database "BIClass" from a single of the flattened data. One of the tasks of the project was to add these three additional columns to each of the tables (AlterTableAddColumnsUserAuthorizationKeyAndTwoTimeStamps): […]

3 (3)

You rated this post out of 5. Change rating

2019-11-18 (first published: )

991 reads

Technical Article

Function and Queries to Convert Hierarchical Adjacency to Nested Json Arrays

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,988 reads

Technical Article

sp_PerfSQ

A diagnostic tool for identifying Performance features of active SQL Queries. It collects performance detail from DMVs for queries with executing requests and is designed to demonstrate and quantify Query Shaping optimisation techniques by: quantifying query workload and throughput characteristics providing behavioural descriptors of potential performance inhibitors - refer column ThrottlePotential The ThrottlePotential column is […]

5 (3)

You rated this post out of 5. Change rating

2019-11-07

4,057 reads

Technical Article

Generic trigger for maintaining the Audit Log

This trigger will work even if you don't have the primary key on any table. Mechanism to configure the primary key in config table has been provided. This can be very helpful to solve the system audit requirements without much efforts.

Disclaimer : Audit Log trigger has performance overhead. It’s meant for table which is not frequently updated, deleted or inserted. Please take precaution when creating the trigger on the table having too many columns.

2.33 (3)

You rated this post out of 5. Change rating

2019-10-15 (first published: )

2,931 reads

Blogs

Simple Talks Episode 9–Data masking and subsetting

By

The episode on data masking and subetting is out. You can see it here:...

T-SQL Tuesday #180: Avoid Perfect for Good Enough

By

I'm listening to Effortless by Greg McKeon (link to author's page) through Audible.com. He...

Book Review – Humanizing Data Strategy by Tiankai Feng

By

This book was making its rounds on social media, and the concept seems interesting...

Read the latest Blogs

Forums

SQL server help (converting rows to columns)

By don075

I am using the following sql to convert rows into columns for each pid,...

Ingesting Data From REST API endpoints: Data Engineering with Fabric

By John Miner

Comments posted to this topic are about the item Ingesting Data From REST API...

Separate Reads

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Separate Reads

Visit the forum

Question of the Day

The Hash Join I

What are the two inputs called to a hash join operation in SQL Server? (choose 2)

See possible answers