Transact SQL – STRING_AGG – Error – “Incorrect syntax near ‘within'”

Background Working on a script, but noticed an error when I tried to sort the data using the String_Agg within group clause. Code Let us reproduce using a sample data set. SQL Sample -01 SQL Output Sample -02 Outline If one reviews our output, one will notice that the cities are listed based on the … Continue reading Transact SQL – STRING_AGG – Error – “Incorrect syntax near ‘within'”

Transact SQL – Non-ANSI Joins

Background Trying to see which SQL modules uses legacy Non-ANSI SQL Joins. Discovery There are a couple of pathways we can use to find sql code that relies on Non-Ansi SQL Joins. The mediums we will use are :- Code Execute Code Dynamic Management Views System Catalog Views sys.sql_Modules SQL Server Profiler Code Code Execution … Continue reading Transact SQL – Non-ANSI Joins