The following query works fine:
select ProductNumber,Name,Color,ListPrice
from Production.Product
where ProductNumber = 'AR-5381'
Where as when, I'm writing my code like following to retrieve value from SQL sever:
declare @ProductNum nvarchar
set @ProductNum = 'AR-5381'
select ProductNumber,Name,Color,ListPrice
from Production.Product
where ProductNumber = @ProductNum
I'm not able to get the values. But ProductNumber('AR-5381') is present in the table. What I'm doing wrong?