Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SP returning no records
Message
From
26/11/2012 11:13:28
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01558050
Message ID:
01558067
Views:
37
>>>What is fred doing at the end of your code - was it for test? Add print @SQL before executing, you will see the error.
>>>
>>
>>See my reply to Boris.
>
>You have an extra + before like.
>
>It should be
>
>where myField LIKE '%' + @SomeNumber + '%'
>

I am concatenating strings, this is my current code:
SET @sWhereClause = @sWhereClause + @NewLine + ' AND [cus_number] LIKE + ''%'' + @cus_Number + ''%'''
strangely enough it works as is, but I'm not quite understanding how the string concatenation is working here anyhow.

>Also, if the number is nchar(5) when what is the point of using LIKE at all? You should use
>
>Number = @SomeNumber

See my conversation with Boris regarding this.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform