I have a C# dictionary object I would like to pass to an SQL stored procedure and compare its contents to a field containing JSON string.
Dictionary<String,Object> d = new Dictionary<String,Object>
d.Add("A",True);
d.Add("B",False);
Let's presume that the table content is as follows. Based on the above dictionary would mean that the stored procedure returns record #2.
ID JSON
----------------------------------------
1 { "A": false, "B": false }
2 { "A": true, "B": false }
I am aware of something called TVP but have no idea how to implement this in SQL or how to parse JSON. How would I achieve this?