chokka
asked on
How to execute a stored procedure by fetching row by row from a Table
In SQL, How to execute a stored procedure by fetching row by row from a Table ?
I have around 50 Stored Procedures which I have to execute one by one. All the stored procedures are mentioned in a Table along with their parameters.
At present, I am using a cursor to do this. Is it possible to implement the syntax through Row_Number - Partition Over by without using While Loop or Cursor ?
I have around 50 Stored Procedures which I have to execute one by one. All the stored procedures are mentioned in a Table along with their parameters.
At present, I am using a cursor to do this. Is it possible to implement the syntax through Row_Number - Partition Over by without using While Loop or Cursor ?
I don't think it's possible to do it without have a loop or a cursor.
Not really. But unless there's more than several thousand rows, even a cursor should do that just fine.
The problem is likely just waiting on all the stored procs to finish. You could, instead, create a job for each that executes all the procs, then start the job. Then your main code will get control back immediately after the job starts, you won't have to wait for all the procs to complete.
The problem is likely just waiting on all the stored procs to finish. You could, instead, create a job for each that executes all the procs, then start the job. Then your main code will get control back immediately after the job starts, you won't have to wait for all the procs to complete.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you , So bottom line is - To execute stored procedures one by one , Either we need to use Cursor or While Loop. There is no other option within the 5-6 lines of SQL Syntax.
ASKER
Thanks