Skip to content
Advertisement

SQL – How to store JSON_QUERY output to variable

I have this query in which I’m trying to store the query output into @json variable but getting syntax error

Error:

Msg 156, Level 15, State 1, Line 11
Incorrect syntax near the keyword ‘AS’.

How can I do that?

Advertisement

Answer

Following VBokšić’s link I made this query as answer:

Output:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement