Re: SQL Server 2005 Common Table Expression

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,


"John Mace" <mace@xxxxxxxxx> skrev i en meddelelse
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.