Msg 8114, Level 16, State 5, Procedure spGetDetails, Line 88
Error converting data type varchar to numeric.
I have already converted this @mfr_id to int type then also getting the above error.
I’m getting error while executing stored procedure.
The line which I’m getting error is:
if(@mfr_id = 5)
Use:
Value comparisons have to be the same data type, or there has to be implicit data type conversion. Explicit conversion — which is when you use CAST/CONVERT — is ideal for maintenance because the operation is obvious.
Depending on your needs, the ISNUMERIC function might help. And be careful to define a length to your [n]varchar variables.