Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Hi all, 4 years ive been using this site but im afraid I need to post I have a proc that has two declarations @cost@extraCostnow im trying to pass these to another proc after some calculations and it kind of looks like this EXEC stp_someOther @1, @2, @cost + @extraCost Both cost and extraCost are of type decimal(18,2) but computer says no and I get invalid syntax near "+" Can someone please help me work out why?Thank you! Pacewhen life hands you lemons, ask for tequila and salt
jen
Master Smack Fu Yak Hacker
4110 Posts
Posted - 2006-07-28 : 04:43:01
do the math inside the sp or before you pass it to the sp --------------------keeping it simple...
Pace
Constraint Violating Yak Guru
264 Posts
Posted - 2006-07-28 : 04:49:25
Thanks Jen... Dont think I have done that before... im a .net dev by trade... my godly sql dude has decided to sun himself in some foreign country... can you show me how I would do the calculation if possible? @calcCost = @cost + @extraCost doesnt seem to work...when life hands you lemons, ask for tequila and salt
Pace
Constraint Violating Yak Guru
264 Posts
Posted - 2006-07-28 : 04:50:39
Ahh ahh! SET @calcCost = @cost + @extraCostWootness! when life hands you lemons, ask for tequila and salt
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2006-07-29 : 01:20:02
orSELECT @calcCost = @cost + @extraCostMadhivananFailing to plan is Planning to fail