following T-Sql code:
DECLARE @usu VARCHAR(10);
SET @usu = 'TOM';
PRINT @usu;
RAISERROR ('Name of USU is %i ',14,2,@usu);
returns following error:
Msg 2786, Level 16, State 1, Line 4
The data type of substitution parameter 1 does not match the expected type of the format specification.
Does anyone know how I can get rid of this error?
Yeah, change your format to Name of USU is %s
, the %i
means the value of @usu
is a signed integer. All of the format types are clearly documented on MSDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With