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.
| Author |
Topic |
|
Sschuster
Starting Member
26 Posts |
Posted - 2005-12-21 : 13:26:11
|
| Inside a stored proc I have a series of UPdate commands. One of which needs the result of a another stored proc. The Update is for a temp table.It looks like this...Update #PositionSet ClosePrice = PFX_GetClosePriceByCurrency #Position.CurrencyItem, @ToDateSo PFX_GetClosePriceByCurrency takes two parameters. One parameter comes from #Position table itself and the other is a date that is a parameter of the main SP.My problem is that I continue to get a syntax error saying "Incorrect syntax near '#Position', like it doesn't recognize it.Some of the other update commands in this SP use similar syntax so it seems that it should work.This works in the other commands...Update #PositionSet ProfitLoss_CC = #Position.LongAmount + #Position.ShortAmountAny ideas? Is there a special syntax you have to use to call a SP from within an Update command? |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2005-12-21 : 13:30:33
|
you can't use a stored proc in a update statement - you can however use a function - search a bit in books online.Duane. "It's a thankless job, but I've got a lot of Karma to burn off." |
 |
|
|
Sschuster
Starting Member
26 Posts |
Posted - 2005-12-21 : 13:36:33
|
| Ahhh. That's what I needed to know. I'll give that a shot. Thanks for the quick reply. |
 |
|
|
|
|
|