gpt4 book ai didi

sql - RAISERROR 引发替换参数错误

转载 作者:行者123 更新时间:2023-12-04 21:51:13 24 4
gpt4 key购买 nike

以下T-Sql代码:

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.



有谁知道我如何摆脱这个错误?

最佳答案

是的,将您的格式更改为 Name of USU is %s , %i表示 @usu 的值是一个有符号整数。所有格式类型都清楚documented on MSDN .

关于sql - RAISERROR 引发替换参数错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19296072/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com