I am maintaining a column in SQL server database for storing a text file(JSON) with some other fields.
Type: varchar(max),The column can be null sometimes.
A C# application reads some log files which are in JSON format and insert the file into database using insert query. The file is inserted as a string.
My problem is the JSON can file can contain single quote letters in between texts, I have faced this issue and fixed by escaping the single quote by referring this question.
My questions are
What all are the validation or escape characters I need to be aware while sending a file as the string to the database in my c# application.
is there any better way to maintain a file in the database other than as varchar text.
If any points are not clear for you, please post your concerns in the comments.
I hope code snippets are not needed for this query.
Thanks.