l had a parameter in my stored procedure that was varchar(2000)
, my problem now is the characters being sent on the parameter have grown, the parameter now needs to handle 30 000 characters which are comma-separated. The biggest variable type that am now using (TEXT) is giving me issues in my where clause as below
Now using TEXT data type
CREATE PROCEDURE
(@ArrayList TEXT ='' -- '93238128,93238131,93238130,93238133,93238132 ......
)
then in my where clause
WHERE c.CLAIM_ID IN (SELECT Element FROM dbo.Split(@ArrayList ,','))
AND @ArrayList <>'') OR @ArrayList =''
Getting this error :
The data types text and varchar are incompatible in the not equal to operator.