Recursion Queries with a stored procedure.

  • Do you have a way to use a recurser query with a stored procedure i have run into an issue to make a recurser query to show what products were consumed in a work order I need to be able to have the user enter the work order number and LOT and Sublot? then that info is fed into the recurser query. is that something that is possible in SQL?

  • Should be. What do you need the recursion for, getting component parts?

  • So when the user types in SKU they want all the components that were consumed to make that work order.

  • So you query and find all the components of the stuff in the work order that have no children - because that's the definition of the lowest part on the component tree.

  • As you have not provided us with any sample DDL or data, we cannot give you a coded solution. But the answer to the question: "Can queries in SQL Server be recursive?" is yes.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply