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)
2,082 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,883 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,522 reads
STRING_SPLIT with Index as Table-Valued Function
2019-11-01 (first published: 2019-10-19)
6,785 reads
STRING_SPLIT with Index as Table-Valued Function
2019-11-01 (first published: 2019-10-22)
454 reads
Function to pad bigint with leading 0's or other single character
2019-10-31 (first published: 2019-10-23)
770 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)
3,126 reads
I am using database properties to add some useful information for each database. Tired of exploring each database from the menu in SSMS to look for specific information, I decided to make a script listing the extended properties for all my databases. I am pleased to offer this to the community 🙂
2019-10-01 (first published: 2019-09-20)
1,538 reads
Functions to list the number of work days in period , determine if a given date is a work day, add work days to a given date.
Uses a table of holidays and a tally table.
2019-09-24 (first published: 2019-09-04)
3,771 reads