Transact SQL :- Temporary Table & Conditional Creation

Background Transact SQL offers the best programming space of all the top tier relational database. But, there are areas one can stumble over, as well. Temporary Table Simple Let us create a simple temporary table Different Structure Objective Depending on certain conditions, our table structure might need to be different. Column 2 If @type is … Continue reading Transact SQL :- Temporary Table & Conditional Creation

Azure Data Studio – Extension – “sqlops-spexecutesql-to-sql” ( v1.0.1 )

Background Wanted to give a quick update on the Azure Data Studio Extension, sqlops-spexecutesql-to-sql. Lineage Azure Data Studio – Extension – "sqlops-spexecutesql-to-sql" Original Post Date Posted :- 2019-August-24th Link Bug Report Outline Filed a bug. The code is on GitHub and path way to filling a bug it to : Sojourn to GitHub Access Pejman … Continue reading Azure Data Studio – Extension – “sqlops-spexecutesql-to-sql” ( v1.0.1 )

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 – JSON Functions – OPENJSON

Background The OpenJSON function allows us to shred a JSON Object into relational rows. Legend Here are earlier posts on Transact SQL & JSON :- Transact SQL – JSON Functions – JSON_VALUE & JSON_QUERY Link JSON Data Code Declare Table Variable & Add data SQL Output Queries Query -01 Outline In our first example, we … Continue reading Transact SQL – JSON Functions – OPENJSON

Transact SQL – JSON Functions – JSON_VALUE & JSON_QUERY

Background Whenever I see JSON mentioned I tighten up a bit, knowing it is one more thing to learn, and I just move on. Transact SQL Let us address how to use a couple of JSON Functions in Transact SQL. VALUE & QUERY Both functions are the same outside of the fact that one returns … Continue reading Transact SQL – JSON Functions – JSON_VALUE & JSON_QUERY