Groups | Blog | Home
all groups > dotnet compact framework > january 2008 >

dotnet compact framework : Problem with SQL CE, select with sum and SqlCeResultSet


carnivore
1/21/2008 8:41:17 AM
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:
Ginny Caughey [MVP]
1/21/2008 9:45:00 AM
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.

--
Ginny Caughey
Device Application Development MVP
www.wasteworks.com
Software for Solid Waste Management



[quoted text, click to view]
AddThis Social Bookmark Button