June 1, 2005 at 1:32 pm
hi all
in sql server this query run very well
but in sql ce not
select
c.tiponegocio,dp.cveprocto,sum(dp.cajas) cajas
from prvDetallePedido dp
inner join (select cvecliente,case when cvetiponegcontrolado >= 503 and cvetiponegcontrolado <= 509
or cvetiponegcontrolado = 516 then 1 else 0 end tiponegocio from prvcliente) c
on dp.cvecliente = c.cvecliente
where dp.cvetipoprocto = 2
group by c.tiponegocio,dp.cveprocto
any idea how i can write this query for SQL CE?
Thanks
June 1, 2005 at 1:34 pm
What's the error message??
Can't see any error in that query...
June 1, 2005 at 1:53 pm
hi Remi
this a error message
FAILED: select
c.tiponegocio,dp.cveprocto,sum(dp.cajas) cajas
from prvDetallePedido dp
inner join (select cvecliente,case when cvetiponegcontrolado >= 503 and cvetiponegcontrolado <= 509
or cvetiponegcontrolado = 516 then 1 else 0 end tiponegocio from prvcliente) c
on dp.cvecliente = c.cvecliente
where dp.cvetipoprocto = 2
group by c.tiponegocio,dp.cveprocto
Error: 0x80040e14 DB_E_ERRORSINCOMMAND
Native Error: (25501)
Description: There was an error parsing the query. [Token line number,Token line offset,,Token in error,,]
Interface defining error: IID_ICommand
Param. 0: 4
Param. 1: 13
Param. 2: 0
Param. 3: select
Param. 4:
Param. 5:
June 1, 2005 at 1:59 pm
Can't help you there, sorry. I've never sued used CE and this error message doesn't help me at all understand the problem.
Have you tried breaking the query apart to see where it fails?
Maybe you could try running the main query without the derived table, and then the derived table only. If you don't have any errors from those queries, then maybe the aliasing technic is different with CE.
June 1, 2005 at 2:00 pm
... And what does CE stands for?
June 1, 2005 at 2:06 pm
OK, Remi
Thanks
June 1, 2005 at 2:11 pm
CE = Cool Engine
is the smallest foot print for MS mobile applications
* Noel
June 1, 2005 at 2:14 pm
Thanx.
Hey looks like I'm finally passing you for the post count .
June 1, 2005 at 2:18 pm
Good for you!!! .
Do you work for a company or are you freelance ?
* Noel
June 1, 2005 at 2:45 pm
i work company for a company
June 2, 2005 at 3:38 am
Always keep in mind that SqlServerCE isn't a true SQLServer! This is, it doesn't support most of the tsql query you're used to probably - including the inner joins from select statements and also group by - I'm not sure which are the changes in the latest SqlServerCE engine but I would check for every reference from Microsoft since I could never find a all stable release! I've developed an app that was using sqlserverce as the db engine and I've changed it. I've built my own engine - for speed and security reasons I still can't embrace the SqlServerCe engine!
For your problem - nothing better than Microsoft's own explanation on what you can, or cannot, do using tsql against the sqlserverce engine.
Hope it helps
June 2, 2005 at 6:49 am
Compagny... never been much of a freelancer.
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply