January 24, 2006 at 5:06 am
Hi,
I have a query which is returning the values based on parameter.
If i give the following query it is returning the values successfully.
select * from externalBrands where extbName like '%^[7 Diamonds !!! !^]%' Escape '^'
but if i give the query like this, it is returning zero rows.
declare @STR varchar(50)
set @STR = '''%^[7 Diamonds !!! !^]%'' Escape ''^'''
print @STR
select * from externalBrands where extbName like @STR
When i check the @STR, the value of @STR is '%^[7 Diamonds !!! !^]%' Escape '^'
So, when i pass the string directly to the query, i am getting rows, but if i pass thru variable, i am getting the zero rows.
Please let me know the actual reason?
Thanks in advance.
Regards
Thirumalaraj
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply