You are trying to concatenate a string and an integer.
You need to cast @ID as a string.
try:
SET @sql=@sql+' AND Emp_Id_Pk=' + CAST(@ID AS NVARCHAR(10))
You are trying to concatenate a string and an integer.
You need to cast @ID as a string.
try:
SET @sql=@sql+' AND Emp_Id_Pk=' + CAST(@ID AS NVARCHAR(10))