August 26, 2008 at 2:56 am
Bhuvnesh,
I guess you have not gone through the problem fully.
Thanks,
Amit Khanna
August 26, 2008 at 3:09 am
Hi Amit Khanna,
Thanks for ur reply. I am an asp.net developer, not a dba :rolleyes: but still i have a good knowledge on db.
I have used joins on tables, but this CTE is something new, is it a temporary table? How and when is it populated? Actually i want to know the basics of CTE.? I know it acts like a cursor, but when should one use this CTE?
Thanks,
sg
August 26, 2008 at 4:47 am
Please go through the below link.
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/d4c26311-d9f4-432c-953a-1c1042b33c97.htm
August 26, 2008 at 6:01 pm
sg (8/26/2008)
Hi Amit Khanna,Thanks for ur reply. I am an asp.net developer, not a dba :rolleyes: but still i have a good knowledge on db.
I have used joins on tables, but this CTE is something new, is it a temporary table? How and when is it populated? Actually i want to know the basics of CTE.? I know it acts like a cursor, but when should one use this CTE?
Thanks,
sg
Not all CTE's are recursive... but, YES, recursive CTE's are kinda like cursors with only slightly better performance. Overall, a CTE is about the same as a "derived table" in a FROM clause, but it can be referenced more than once in the query that follows and, as you've seen, can call itself recursively.
My recommendation is to avoid as many forms of recursion as you can including the running total recursive CTE that's been posted. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply