Posted by David Portas on 03/02/06 22:21
Doug wrote:
> the jump where sql can be categorized as "primitive recursive
> functions" lost me.
>
> Is there a practical limit on how levels of recursion SQL supports?
> Does the SQL spec guarantee that recursion has to be available for say
> 1000 layers?
>
> As I understand your logic, you are stating you can use declarative SQL
> recursively to fulfill the looping role. I am questioning whether the
> SQL spec guarantees say a million levels of recursion.
>
> Am I understanding your premise correctly?
Of course there are practical limits to everything in finite state
machines and real hardware. What is your point? That the resource
constraints on cursors are inherently less onerous than on recursive
queries? If we are talking at the logical level then that is
irrelevant. If we are talking about real implementations then I think
any of the major SQL databases demonstrate otherwise. Those systems are
designed and optimized to perform with set-based operations and more
often than not the set-based operations perform best.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
Navigation:
[Reply to this message]
|