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.
2019-11-25 (first published: 2019-11-24)
719 reads
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): […]
2019-11-18 (first published: 2019-11-10)
994 reads
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.
2019-11-12 (first published: 2019-11-08)
1,990 reads
T-SQL query to return the latest available database backup chain (Full, Differential and Log) of individual databases along with their backup size and compressed size.
2019-11-08 (first published: 2019-10-30)
3,433 reads
T-SQL query to copy the rows of all the tables from one database to another database only if they have rows in Source DB and exact same Schema in both Source and Destination DB.
2019-11-07 (first published: 2019-10-30)
5,280 reads
STRING_SPLIT with Index as Table-Valued Function
2019-11-01 (first published: 2019-10-19)
6,422 reads
STRING_SPLIT with Index as Table-Valued Function
2019-11-01 (first published: 2019-10-22)
418 reads
Function to pad bigint with leading 0's or other single character
2019-10-31 (first published: 2019-10-23)
748 reads
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.
2019-10-15 (first published: 2019-10-10)
2,940 reads