Ravi Shakya

Ravi Shakya

  • NA
  • 21
  • 20.6k

SQL server query Error

Sep 13 2013 2:17 AM
declare @ID as nvarchar(50)=''
SET @ID='1,2,3'
Select * from Orders_tbl where OrderId in (@ID)


Showing An error-

Msg 8114, Level 16, State 5, Line 3
Error converting data type nvarchar to numeric.

But working fine with direct values.

Answers (3)