Skip to content Skip to sidebar Skip to footer

Sql Server Clr Stored Procedure Json Parameter

I've come across a scenario where I want to pass a large amount of data to a Stored Procedure for generating some dynamic SQL. The data I want to pass is stored in this Json/C# cla

Solution 1:

It is possible; please see the canonical reference on dynamic SQL: The Curse and Blessings of Dynamic SQL

Solution 2:

I've tried to use my code to parse a JSON string parameter but the required namespaces are not available in a SQL CLR project and I have therefore switched to the documented Xml parameter.

Solution 3:

You can only use an unsafe assembly such as DataContractJsonSerializer if you're building an unsafe assembly yourself. The other option is to skip the reference to and use of the unsafe assembly and write your own JSON parse code (or copy it from someone else.)

Post a Comment for "Sql Server Clr Stored Procedure Json Parameter"