Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Raiserror and numeric parameters (real, float)
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Raiserror and numeric parameters (real, float)
Miscellaneous
Thread ID:
01226806
Message ID:
01226806
Views:
700
Hi guys,

The same code below, works fine when I run it using MSSQL 2000, but doesn't work if I try it using MSSQL 2005 (Express).
Declare @Var1 Integer, @Var2 Numeric (9,3)
Set @Var1 = 1
Set @Var2 = 2
RaisError('Var1 = %i Var2 = %i',16,1,@Var1, @Var2)
2000 returns

Server: Msg 50000, Level 16, State 1, Line 4
Var1 = 1 Var2 = 2

2005 returns

Msg 2786, Level 16, State 1, Line 4
The data type of substitution parameter 2 does not match the expected type of the format specification.
The problem is @Var2 that is numeric(9,2) and is not integer. I think I have to replace the second %i. I tried to do something different, but no way.

I don't want to use something like (COMPATIBLE = 2000, actually I don't know if it exists in SQL, but I want to convert my application to SQL 2005).

Any idea?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rodolfo Duarte
Next
Reply
Map
View

Click here to load this message in the networking platform