Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Jason, I loved the post on automating JSON imports into sql via dynamic stored procs. I have a situation however where we will not know the structure of the json object and it could be anything (.net solution that users paste info online and we generate a grid of data).

what i couldn't tell from that blog if there was a way to build the sp where you could still pass the json as a variable and have the sp create the columns dynamically. it says that it can but i didn't follow the part where you set the columns types for the expected data types.

if there is a clean way to do it i would love to stay with .net structure and not have to use another library.

any feedback would be great. thanks,
jason

What I have tried:

several libraries and doing it myself in .net but it's not clean and very clunky
Posted
Updated 14-Aug-16 15:44pm
Comments
pradeep kumar 13-Aug-16 19:06pm    
Create an UDT, put all your JSON data in #temp table or something, from there you can able to cast or convert to expected data types.
Patrice T 15-Aug-16 6:26am    
Are you talking about a CP article ? id so, tell us the url.
Use Improve question to update your question.

1 solution

JSON Data (SQL Server)[^]

Try this tutorial
 
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