Re: SQL Server 2005 Common Table Expression
- From: "Michael Gaihede" <miga@xxxxxxxxxxxxxxx>
- Date: Thu, 9 Feb 2006 21:17:50 +0100
Hi John,
Thanks for your response - I appreciate it.
I'm not entirely sure that I agree on the coolness factor - frankly I think
they're a bit of a hack (e.g. compared to Oracle). Also, the fact that the
ADOs don't appear to support them make CTE cumbersome to use.
Anyway, regarding your suggestion, I need to pass a parameter (a node-id)
to the select statement, and - as far as I can see- the only way to get a
result using a view would be to create a temporary table and have the view
operate on that ?
Best regards and thanks,
Michael
"John Mace" <mace@xxxxxxxxx> skrev i en meddelelse
news:43eb81c2$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Michael,
In SQL Server 2005, a new construct - Common Table Expression
These are very cool, aren't they?
...
When using *any* ADO component from D2006/W32, however, the error
"Incorrect syntax near the keyword WITH" is returned.
I don't know if this will help, but I've had better luck burying some
things in the backend. I just solved one problem by creating a
table-valued function to do the hard lifting and then creating a view
which just does a SELECT * FROM dbo.MyFunction(). The BDP adapters seem to
deal with views alright. You might try something similar so that the
Delphi components never see the WITH statement.
HTH,
John
.
- References:
- SQL Server 2005 Common Table Expression
- From: Michael Gaihede
- Re: SQL Server 2005 Common Table Expression
- From: John Mace
- SQL Server 2005 Common Table Expression
- Prev by Date: Re: SQL Server 2005 Common Table Expression
- Next by Date: AD0->SQL Server Connection Problem
- Previous by thread: Re: SQL Server 2005 Common Table Expression
- Next by thread: AD0->SQL Server Connection Problem
- Index(es):