Json进入SQL服务器SP [英] Json into SQL server SP

查看:81
本文介绍了Json进入SQL服务器SP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

杰森,我喜欢通过动态存储过程自动将JSON导入sql的帖子。我有一种情况,但我们不知道json对象的结构,它可能是任何东西(.net解决方案,用户在线粘贴信息,我们生成一个数据网格)。



我从该博客中无法分辨的是,如果有一种方法可以构建sp,你仍然可以将json作为变量传递,并让sp动态创建列。它说它可以,但我没有按照你设置预期数据类型的列类型的部分。



如果有一个干净的方法来做它我很想继续使用.net结构而不必使用另一个库。



任何反馈都会很棒。谢谢,

jason



我尝试过:



几个库并在.net中自己做这个但是它不干净且非常笨重

解决方案

JSON数据(SQL Server) [ ^ ]



尝试本教程


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

解决方案

JSON Data (SQL Server)[^]

Try this tutorial


这篇关于Json进入SQL服务器SP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆