SYMPTOMS
The msg_str parameter in the Raiserror function can include a %i type specification to represent a signed integer value. This type specification does not return the correct value.
For example, the following statement:
Raiserror ('Database has not been dumped in %i hours.',16,2,123)
returns a message that resembles the following (the actual number returned will vary):
Server: Msg 50000, Level 16, State 2, Line 1
Database has not been dumped in 805895076 hours.
Raiserror used with
sp_addmessage behaves in the same way; for example, the following code:
sp_addmessage 50005, 16,
'Database has not been dumped in %i hours.'
go
Raiserror (50005, 16, 1, 123)
returns a message like this (again, the number will vary):
Server: Msg 50005, Level 16, State 1, Line 1
Database has not been dumped in 805895076 hours.