JSON Path Vs String Concatenation
--
I do have a scenario where I need to make a JSON in a batch for a million rows in a sql server table. Ideally my first inclination is to use the JSON Path as that gives me a clear JSON value which is good to maintain, soon enough I did realize JSON Path do have a performance cost it.
Verdict:
Using SQL Concatenation I was able to get the result in 3 seconds compared to 16 seconds on the JSON Path, thus I recommend to use SQL Concatenation for batch operations, where we are confident on the datatypes and ok to invest time in the maintenance later on (as the code looks a lot messier with string concat)