Function Recursive

  • 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

  • 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.

  • 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