Problem with SQL CE, select with sum and SqlCeResultSet

  • Thread starter Thread starter carnivore
  • Start date Start date
C

carnivore

Hello,
I have a field named "value" defined as numeric(9,3) in a Sql Server CE
(3.0.3600.0) database. I do a simple select query with one join and sum
on field value. This query works good on sql server management studio
but if it is executed in SqlCeResultSet i get a error:
Expression caused an overflow [,,, Name of function
(if known),,] Native Error: 25901

I must do
convert(numeric(18,3),sum(value)) as sumValue
and everything is ok, but why? In SqlCe manual i found

Expression result Return type
numeric category (p, s) numeric (38, s)

What's wrong?


This same problem was described in this thread:
http://tinyurl.com/2uez8b
 
That sounds like a limitation of the parser, and since you've found syntax
that does work, I'd just go with that. Interestingly in SQL Compact 3.5,
although Top is supported as a keyword, you have to include the parentheses
whereas for SQL Server they're optional.
 
Back
Top