Search This Blog

Issue:Unclosed quotation mark after the character string ''.

Unclosed quotation mark after the character string in SQL


Issue:Msg 105, Level 15, State 1, Line 1
Unclosed quotation mark after the character string ''.


Issue Reason: Apostrophe (')  is used in sql to start and end the string.So including  Apostrophe (')  in any string or varchar values will throw the above error.
for eg: if you run below query it will thrown the above error
Select 'Indian's'

Msg 105, Level 15, State 1, Line 1
Unclosed quotation mark after the character string ''.


Solution:To fix this issue you need to add one more Apostrophe (')
Select 'Indian''s'

Output:Indian's

Note :when Inserting the values containing   Apostrophe (') from your web application or system applications into SQL you can replace the Apostrophe (') with double Apostrophe ('') by using Replace Function.

No comments:

Post a Comment