SQL IN多值传参方法
DECLARE @preName nvarchar(4000)
SET @preName='@Davolio@,@Fuller@,@Leverling@'
declare @lastName nvarchar(4000)
set @lastName=replace(@preName,'@','''')
declare @sql nvarchar(2000)
set @sql=N'SELECT *FROM Employees where lastName IN ('+@lastName+')'
execute sp_executesql @sql