Escape in sql server 2000

  • while i am writing query,

    select * from table name where column like '%N%' escape'\' in oracle its gives the output.... but i am execute the query on sqlserver2000 'll show error message of

    Incorrect syntax near the keyword 'ESCAPE'.

  • This one should work in SQL, you may have something else wrong in the query. Try to clear everything before and after your statement...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • This was removed by the editor as SPAM

  • select * from table name where column like '%N%' escape'\'

    I suggest removing escape '\' because the only reason you'd need it is to indicate that % should be interpreted literally (like as escape '%').

    Edit: More info on this syntax can be found here: http://msdn.microsoft.com/en-us/library/ms179859.aspx

    And the problem is this syntax was introduced in SQL 2005.


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply