April 15, 2008 at 11:36 am
Hello,
Well i have never check that either recursive function is possible in sql server (any version) is possible or not. Is any person having experience about that???????????
thanks
April 15, 2008 at 12:18 pm
Can you explain what you need to do? Sql Server works best with sets and recursion is typically a row by row operation. My guess is that there is a set-based solution to your problem.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
April 15, 2008 at 12:29 pm
You can have recursive triggers (which are usually a problem, but can be done if needed) in SQL Server.
You can have recursive procs in both 2000 and 2005 (might be able to earlier, I don't know since I haven't used those).
In 2005, there are recursive CTEs, which are CTEs (Common Table Expressions) that reference themselves in a Union All statement.
However, a view can't reference itself recursively in any version (nor should it). (Note: You can create a view that references itself, but when you try to select from it, you'll get an error.)
User Defined Functions can reference themselves recursively.
In all cases, you can run into the max recursion limit.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply