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!

a stored procedure with parameter

Status
Not open for further replies.

vcllvc

Programmer
Jul 12, 2001
136
US

is it possible to pass a + or - as a parameter in a stored procedure so that it can do something like below:

select price + '@PlusOrMinus' + @newprice from tblRateDetails where ID=@ID

Or I have to accomplish the task using if statement?

Thanks in advance.
 
You can do that using sdynamic SQl, but I would suggest a better way id to append a - sign onto the newprice variable if need be and pass in either a positive or negative number which will then be added to the other number.

Questions about posting. See faq183-874
Click here to help with Hurricane Relief
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top