Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Stored Procedure Help

Author  Topic 

BCullenward
Starting Member

28 Posts

Posted - 2006-08-16 : 11:12:07
I need some help with a stored procedure.

I have a temp table that contains 3 fields:

District,
StoreNo,
Profit

And I have a stored procedure that calculates the profit and has two output parameters based on the district and storeNo input parameters.


I want to be able to run the stored procedure to update the Profit for that District/StoreNo combination without having to re-create the stored procedure and calling the stored procedure via SQL.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-08-16 : 11:42:56
is it a very complicated calcualtion ?
can't you just

update #temp
set profit = <your calculation here>



KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-16 : 11:54:13
or give us more informations

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

BCullenward
Starting Member

28 Posts

Posted - 2006-08-16 : 12:09:18
Yes, it's a rather complicated calculation, taking all the expenses and revenue into account for each store.

I'm looking at turning that stored procedure into a Scalar-value function and selecting that during the insert into a temp table.

Thanks for the prompt replies though.
Go to Top of Page
   

- Advertisement -