Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure - is this a good use for one?

Status
Not open for further replies.

sbbrown9924

Technical User
Mar 7, 2003
80
US
I am building a page that has three parameters on it - a social workers name, start date and end date. I am writing a report that has several statistics such as "how many days during the month did the worker work?", "how many patients did the worker see"? "What kind of interventions did the worker provide"? "What was the cost/benefit of the services the worker provided to the hospital?" So I've had to build several queries on this page. Each one must use the 3 parameters to limit the query to the date range and the worker who performed the services. Would this be a good use of a stored procedure - instead of having to parameterize every query?
 
ASP page?

Use a SP or a function. SP is a little more efficient becasue you aren't passing the SQL back and forth. I never find much gain in actual processing in file-based dbs by going with SPs.

But...write a different SP for each query. Don't lump them all in one. Just call the one you need.

Practically, using SPs makes your code easier to read and maintain, encourages reusability, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top