SQL Server Performance

Understanding Single quotes within a SELECT statement

Discussion in 'Other SQL Server Blogs around the Web' started by Anonymous, Feb 19, 2008.

  1. Anonymous New Member

    This is for newbies who struggle to understand how single quotes work in SQL Server I have seen newbies worrying why the following doesnt work SELECT columns from mytable where col = 'Lifco' s ' When you specify a value which has single quote , you need to double it SELECT columns from mytable where col = 'Lifco'' s ' The following may be helpful ( Run and see the result ) SELECT '' , '''' , '''''' , '''''''' , '''''''''' When you use a static sql and express a value in a single quote then first...(<a href="http://sqlserver-qa.net/blogs/t-sql/archive/2008/02/19/3569.aspx">read more</a>)<img src="http://sqlserver-qa.net/aggbug.aspx?PostID=3569" width="1" height="1">

Share This Page