Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server 2005 General Discussion
»
Function Recursive
Function Recursive
Rate Topic
Display Mode
Topic Options
Author
Message
kashif ahmed
kashif ahmed
Posted Tuesday, April 15, 2008 11:35 AM
Grasshopper
Group: General Forum Members
Last Login: Wednesday, March 27, 2013 1:51 PM
Points: 22,
Visits: 16
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
Post #485210
Jack Corbett
Jack Corbett
Posted Tuesday, April 15, 2008 12:18 PM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 1:41 PM
Points: 10,613,
Visits: 11,952
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
Applications Developer
Don't let the good be the enemy of the best. --
Paul Fleming
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
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #485228
GSquared
GSquared
Posted Tuesday, April 15, 2008 12:29 PM
SSCoach
Group: General Forum Members
Last Login: 2 days ago @ 1:45 PM
Points: 15,442,
Visits: 9,572
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
Post #485236
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.