For example:StoredProcedure1: Returns a table with columns "year" and "value".StoredProcedure2: Also returns a table with columns "year" and "value".In Stored Procedure3: I would like to use the results from StoredProcedure1 and StoredProcedure2 and join them. Can somebody give me an example how to execute a stored procedure from another one and use the result table for a new command?Kind regards and thanks,carsaw Hello,i need to execute a stored procedure from another stored procedure. The called stored procedure and use this #temp tableĮxecute stored procedure from stored procedure Use a local #temp table which can hold the resultset of Use User defined functions which can return a resultsetĢ. ![]() (performed by "SELECT statusID FROM statusList WHERE statusName= 'Created')īut I also have a second stored procedure that needs to make reference to&n.Ĭalling a Stored Procedure from a Stored ProcedureĬan you do this? I have a sp that returns a list of eligible accounts and then I use that list in other sp but I don't want to keep copying the code, I would like to be able to use it as a sub query in other sp but I don't know if this is possible or what the syntax would be.ġ. For example, I have a simple stored procedure that takes a string as a parameter, and returns its resolved index that corresponds to a record in my database. Hi all - I'm trying to optimized my stored procedures to be a bit easier to maintain, and am sure this is possible, not am very unclear on the syntax to doing this correctly. ![]() Calling a stored procedure inside another stored procedure (or "nested stored procedures")
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |