Click here to Skip to main content
15,921,463 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

iam trying to convert sql table into json format, but while doing it throws error as "
Quote:
Incorrect syntax near 'JSON'.
"

SELECT name, surname  
FROM emp  
FOR JSON AUTO 


where it throws an error. Iam using
SQL server 2014 management studio


What I have tried:

SELECT name, surname  
FROM emp  
FOR JSON AUTO
Posted
Updated 22-Jan-18 17:03pm
Comments
Bryian Tan 22-Jan-18 2:51am    
I think JSON feature is in SQL 2016 onwards
Vinodh Muthusamy 22-Jan-18 2:53am    
is there possible to run in sql2014
Karthik_Mahalingam 22-Jan-18 3:39am    

JSON was added to SQL in the 2016 version, it is not available at all in versions below that.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900