Thursday, August 24, 2006

Sql Server Escape Sequence

Some times we are required to put '(Quotation Mark) in our sql stored procedure query.But '(Quotation Mark) will use for operation in sql server stored procedure. You can use escape sequence here.
for example you want to put 'jalpesh' in stored procedure then you should give
print '''jalpesh'''
here first two quota ion mark counted as escape sequence and then the third ' are counted as character.


  1. Actually, in your example, the first quote is a regular quote. The second quote is an escape character, the third quote is the escaped quote.

    At the end, it's the other way around. You first have the espace character, then the escaped quote and then the final, regular, quote.

  2. We have a DataSet with Table Adapters built for MSAccess using OLEDB. We are using Visual Studio 2005 and .Net 2.0.

    When the designer creates insert, update and delete queries it encloses the table name and field names with a ` (ASCII char 96).
    For example:

    INSERT INTO `table` (`col1`, `col2`, `col3`) values (....)

    Is there a reason for this character? Assuming it's for escape purposes, is there a setting to make Visual Studio use another character, eg "[" or "]"?


Your feedback is very important to me. Please provide your feedback via putting comments.

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog


My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews