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)。 –