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'”

SQL Server – Querying for OS Version

Background As SQL Server now runs on Linux it is likely a good idea to be able to determine the underlying OS that a specific instance is sitting on.   Choices Here are some choices for determining a targeted SQL Instance OS Version :- @@version sys.dm_os_host_info SQL Server Versions v2017 and above   System Function … Continue reading SQL Server – Querying for OS Version