SQL Stored Procedure Error - parameter with "-" character



Hi Everybody,
I had created a stored procedure wherein i had passed the parameter
contains(tablecolumnname,searchstring)
It is working very fine except
if the search string is carrying "-" character.
Let me explain the problem.
if the parameter is
((contains(col1,'"abcd*" '))) then it will return me the results set
with col1 carrying character abcd.

But if I use the same string
((contains(col1,'"xyz-lmn*" '))) then it wont return me the result
set. instead of this i need to modify this parameter as
((contains(nvarchar7,'xyz-lmn '))) then and then it gives me proper
result set.

Can some body tell me why this is happening? I am not an SQL expert.
Little confused about why stored procedure is behaving differently for
parameter containing "-" character.

.



Relevant Pages

  • Re: SQL Stored Procedure Error - parameter with "-" character
    ... I had created a stored procedure wherein i had passed the parameter ... if the search string is carrying "-" character. ... with col1 carrying character abcd. ...
    (microsoft.public.sqlserver)
  • Re: Searching by Unicode codes
    ... What character are you searching for? ... What is its hex number? ... search string ^U0xnnnn, for example - no luck there, and similarly no luck ... Are there any other settings ...
    (microsoft.public.word.application.errors)
  • Re: [Dialog] Cracking Richard
    ... in the database, ... Some people use special formats for sigs or even set sigs to be ... I can see in the hex editor that the control character that precedes ... search string contains regular expressions ...
    (news.software.readers)
  • Re: Find/Replace in TStringList loses lots of data
    ... Nth file character (where N is the search string length) against all ... If it is in the search string it jumps ... Basically one sets up a 256 character array of byte values, ...
    (comp.lang.pascal.delphi.misc)
  • Re: Find & Replace Question
    ... Your statement "That extra character remains part of the ... search string, but you want to keep that character, so ... you mark it with round brackets to enable you to put back ...
    (microsoft.public.word.newusers)

Loading