Skip to content
Advertisement

How to use variables in SQL raiserror

I am trying to show my int variables in raiserror @MaxAmount and @MinAmount

But Im getting error:

Must declare the scalar variable “@MaxAmount”.

Advertisement

Answer

%s is used for varchar and your variable is of type int hence you need to try to use correct format specifier ie, %d

Check RAISEERROR for details.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement