I am trying to insert json value in table but my json contains '
as well hence my query is not well formatted and I get error:
Unclosed quotation mark after the character string
My SQL query text in c# is as follows:
string query = " INSERT INTO [DGS].[DPN].CONSOLESESSIONTRACKING ([UCID], [SessionID], [MUCustomization]) VALUES(" + "'" + ucid + "'," + "'" + consoleSessionTracking.SessionId + "'" + consoleSessionTracking.cust + "'" + ") ";
How can I store json value containing '
in sql? Is there any workaround?