﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Dying to solve this problem :-( "SINGLE QUOTATION" / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 18 May 2013 10:23:07 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Dying to solve this problem :-( "SINGLE QUOTATION"</title><link>http://www.sqlservercentral.com/Forums/Topic1369475-391-1.aspx</link><description>[b]okey :-) thankx for the advice 'll think doing so[/b]</description><pubDate>Tue, 09 Oct 2012 02:45:14 GMT</pubDate><dc:creator>Ahmed_07</dc:creator></item><item><title>RE: Dying to solve this problem :-( "SINGLE QUOTATION"</title><link>http://www.sqlservercentral.com/Forums/Topic1369475-391-1.aspx</link><description>[quote][b]Scott D. Jacobson (10/8/2012)[/b][hr]Obligatory: [url=http://xkcd.com/327/]http://xkcd.com/327/[/url][/quote]+1000 Absolutely agreed!</description><pubDate>Mon, 08 Oct 2012 11:22:06 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Dying to solve this problem :-( "SINGLE QUOTATION"</title><link>http://www.sqlservercentral.com/Forums/Topic1369475-391-1.aspx</link><description>Obligatory: [url=http://xkcd.com/327/]http://xkcd.com/327/[/url]</description><pubDate>Mon, 08 Oct 2012 10:12:56 GMT</pubDate><dc:creator>Scott D. Jacobson</dc:creator></item><item><title>RE: Dying to solve this problem :-( "SINGLE QUOTATION"</title><link>http://www.sqlservercentral.com/Forums/Topic1369475-391-1.aspx</link><description>Or for an even better approach don't use pass through sql from your .NET app. Instead use parameters. From the issues you are facing it is very likely that your application is vulnerable to sql injection.</description><pubDate>Mon, 08 Oct 2012 09:22:18 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: Dying to solve this problem :-( "SINGLE QUOTATION"</title><link>http://www.sqlservercentral.com/Forums/Topic1369475-391-1.aspx</link><description>you're right, it's just that I didn't mentioned or write it in here, but I did wrap it with a single quotation to the whole string :-)thank you :-)</description><pubDate>Mon, 08 Oct 2012 03:12:03 GMT</pubDate><dc:creator>Ahmed_07</dc:creator></item><item><title>RE: Dying to solve this problem :-( "SINGLE QUOTATION"</title><link>http://www.sqlservercentral.com/Forums/Topic1369475-391-1.aspx</link><description>[quote][b]Ahmed_07 (10/7/2012)[/b][hr]I found it :-)here is the solution[code] public string mySTRING (string singleQ){     return singleQ.Replace(" ' ", " ' ' "); }[/code][code="sql"]SELECT ID, TitleFROM viewTopTitlesWHERE Title = mySTRING (you're most welcome)[/code]SOURCE : http://www.sqlfr.com/forum/sujet-PROBLEME-AVEC-APOSTROPHE_1349006.aspxinfo : the forum is in French lang but you should see the full code there probably understand :)[/quote]If you run that result query you posted, I'm pretty sure you'll find that it doesn't actually work.  The single quote needs to have two single quotes and the whole string literal needs to be wrapped in single quotes.</description><pubDate>Sun, 07 Oct 2012 08:23:32 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Dying to solve this problem :-( "SINGLE QUOTATION"</title><link>http://www.sqlservercentral.com/Forums/Topic1369475-391-1.aspx</link><description>I found it :-)here is the solution[code] public string mySTRING (string singleQ){     return singleQ.Replace(" ' ", " ' ' "); }[/code][code="sql"]SELECT ID, TitleFROM viewTopTitlesWHERE Title = mySTRING (you're most welcome)[/code]SOURCE : http://www.sqlfr.com/forum/sujet-PROBLEME-AVEC-APOSTROPHE_1349006.aspxinfo : the forum is in French lang but you should see the full code there probably understand :)</description><pubDate>Sun, 07 Oct 2012 02:05:46 GMT</pubDate><dc:creator>Ahmed_07</dc:creator></item><item><title>RE: Dying to solve this problem :-( "SINGLE QUOTATION"</title><link>http://www.sqlservercentral.com/Forums/Topic1369475-391-1.aspx</link><description>thanks imexbut it would work in Query Engine in SQL Server but as in my case am in ASP.NET and can't fix with this all the links (Titles) that contain SINGLE QUOTATIONSso how could I avoid the error dynamically ????? :ermm:</description><pubDate>Sun, 07 Oct 2012 00:26:51 GMT</pubDate><dc:creator>Ahmed_07</dc:creator></item><item><title>RE: Dying to solve this problem :-( "SINGLE QUOTATION"</title><link>http://www.sqlservercentral.com/Forums/Topic1369475-391-1.aspx</link><description>Try:[code="sql"]WHERE Title = 'you''re most welcome'[/code]Hope this helps.</description><pubDate>Sat, 06 Oct 2012 16:37:58 GMT</pubDate><dc:creator>imex</dc:creator></item><item><title>Dying to solve this problem :-( "SINGLE QUOTATION"</title><link>http://www.sqlservercentral.com/Forums/Topic1369475-391-1.aspx</link><description>it's only about ( SINGLE QUOTATION) in ASP.NET here is my SQL Query:[code="sql"]SELECT ID, TitleFROM viewTopTitlesWHERE Title = ' you're most welcome '[/code]but duo to the SINGLE QUOTATION I have a fatal Error, I tried to use function like this:[code]WHERE  REPLACE("you're most welcome", " ' ", " ' ' ")[/code]... Error I get with this is : Msg 4145, Level 15, State 1, Line 3An expression of non-boolean type specified in a context where a condition is expected, near ')'.and thene tried like this :[code]WHERE  Title = REPLACE("you're most welcome", " ' ", " ' ' ")...[/code]Error I get with this is :Msg 207, Level 16, State 1, Line 3IS THERE ANY BODY CAN GIVE ME A FULL EX. OF THE QUERY, OR TELLS ME HOW APPROPRIATE SHOULD I'VE TO USE THIS;THANK YOU[u]PS: I AM KINDDA NEW TO THIS[/u] :ermm:</description><pubDate>Sat, 06 Oct 2012 16:22:31 GMT</pubDate><dc:creator>Ahmed_07</dc:creator></item></channel></rss>