0
我想从SQL Server中的存储过程抛出一个自定义错误,但编译时出现错误。问题很明显。我试图显示类型位参数的值,我相信我的格式声明是错误的。我有以下几点:投掷错误 - 错误消息中正确的%格式值
EXEC sys.sp_addmessage
@msgnum = 60000
,@severity = 16
,@msgText = N'Bad parameter. You cannot pass NULLs to this procedure, UseAlternateEquity (%i), AlternateEquity (%d), PushEmail (%i)'
,@lang = NULL;
declare @msg1 NVARCHAR(2048) = FORMATMESSAGE(60000, @UseAlternateEquity, @AlternateEquity, @PushEmail);
throw 60000, @msg1, 1;
变量@UseAlternateEquity
和@PushEmail
的类型位的
有人能告诉我适当的格式类型是什么请。我搜索了高和低,找不到答案
感谢。在传递变量时,我最终使用了convert(int,@var)。 –