Solved

Execute Stored Procedure for a set of values

Posted on 2016-11-21
5
29 Views
Last Modified: 2016-11-29
I have around 10 Stored Procedures each of which takes one argument as an input parameter. I have a table of around 200 ids against which I want to run these 10 stored procedures.  What is the best way of executing this ? Also for each id for each stored procedure run I would like a count of the number of records affected or the stored procedure to return a true or false.

Please let me know if you have any other questions,
Thanks,
Aditya
0
Comment
Question by:giveindia
  • 2
  • 2
5 Comments
 
LVL 32

Accepted Solution

by:
ste5an earned 500 total points
ID: 41895819
What is the best way of executing this ?
It solely depends on your procedures internals. Whether the order should/could be a(1), b(1), c(1)..a(n), b(n), c(n) or a(1),a(2),a(3)..c(1),c(2),c(3)).

"How to execute this?"
Create a cursor and invoke the methods. Don't think about using dynamic SQL, when you cannot justify its usage.

for each id for each stored procedure run I would like a count of the number of records affected or the stored procedure to return a true or false.
It solely depends on your procedures internals. When the procedures do not expose those numbers, there is no way to get them. Cause to calculate it otherwise means that you need to replay the sprocs internals.
0
 

Author Comment

by:giveindia
ID: 41905326
Nevermind. I handled it through a console application written in .NET.

Thanks,
Aditya
0
 

Author Comment

by:giveindia
ID: 41905473
Nevermind. I handled it through a console application written in .NET.

Thanks,
Aditya
0
 
LVL 32

Expert Comment

by:ste5an
ID: 41905527
You've asked for the best method. Using .Net is not the best method, cause it requires an extra layer in a different technology.

Also my caveat still holds: You cannot rely on the records affected value.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
javascript call 6 36
Duplicate a row 2 33
Paging GridView 7 34
Jquery autocomplete 10 31
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now