Microsoft KB Archive/296637

= BUG: Raiserror with %i Type Displays Incorrect Integer Value =

Article ID: 296637

Article Last Modified on 9/4/2002

-

APPLIES TO


 * Microsoft SQL Server 7.0 Standard Edition

-



This article was previously published under Q296637



BUG #: 58282 (SQLBUG_70)

BUG #: 101143 (SQLBUG_70)



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.



WORKAROUND
Use the %d (signed integer) or %u (unsigned integer) type specification instead.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 7.0.

Additional query words: error raiseerror

Keywords: kbbug kbpending KB296637

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.