Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

select in operator problem

$
0
0

Hi, when I use  this code, it gave empty column

declare @EmployeeID nvarchar(max)=''
set @EmployeeID = '295847284,974026903'
select FirstName, LastName,Title,HireDate,Birthdate,EmailAddress AS Contact 
from dbo.DimEmployee 
where EmployeeNationalIDAlternateKey in( @EmployeeID)

while I replace @EmployeeID with '295847284,974026903',

declare @EmployeeID nvarchar(max)=''
set @EmployeeID = '295847284,974026903'
select FirstName, LastName,Title,HireDate,Birthdate,EmailAddress AS Contact 
from dbo.DimEmployee 
where EmployeeNationalIDAlternateKey in( 295847284,974026903)
it works fine. what is the wrong ?

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>