1
[{"User":[{"UserName":"abc","EmailId":"[email protected]","UserId":1,"UserType":"0","User_Level":0},{"UserName":"jack","EmailId":"[email protected]","UserId":1618,"UserType":"1","User_Level":0}]}]

How can I use this json in a select statement of SQL Server 2016?

I want a select statement which returns output like above json

1
  • Could you provide your sample data ? Commented Dec 13, 2018 at 10:32

1 Answer 1

1

I think you can try to use FOR JSON AUTO with ROOT

SELECT UserName,EmailId,UserId,UserType,User_Level
FROM T
FOR JSON AUTO,ROOT('USER')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.