下面的T-SQL代碼:
RAISERROR引發替代參數錯誤
DECLARE @usu VARCHAR(10);
SET @usu = 'TOM';
PRINT @usu;
RAISERROR ('Name of USU is %i ',14,2,@usu);
返回以下錯誤:
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.
有誰知道我怎樣才能擺脫這種錯誤的?
我會停止做錯誤信息暗示的。 – Kermit
選擇嚴重性14的任何特定原因?通常用於[權限不足](http://www.sommarskog.se/error-handling-I.html#severitylevels) –
請更新相當諷刺的標題,當然RAISEERROR會引發錯誤;) – codemonkeh