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 |
|
chih
Posting Yak Master
154 Posts |
Posted - 2007-09-09 : 21:51:24
|
| Hi Everyone,Please see below example. I want to execute the SP. One of variable I want to change it to negative value (-@num). How can I do it? becasue I alwasy get syntax error.Incorrect syntax near '@num'. Thank youExample,In the Stored procedure, select @num =qty from salesexec salesClaim @id, -@num |
|
|
Zoroaster
Aged Yak Warrior
702 Posts |
Posted - 2007-09-09 : 21:55:05
|
Chih, please post the ddl for the stored procedure. Future guru in the making. |
 |
|
|
PeterNeo
Constraint Violating Yak Guru
357 Posts |
Posted - 2007-09-10 : 01:39:05
|
| Hi,Try this oneDeclare @num intselect @num = -qty from salesexec salesClaim @id, @num |
 |
|
|
chih
Posting Yak Master
154 Posts |
Posted - 2007-09-10 : 01:52:23
|
Hi Zoroaster,Thank you. so there is no way we can use -@num in executing stored procedure statement.quote: Originally posted by PeterNeo Hi,Try this oneDeclare @num intselect @num = -qty from salesexec salesClaim @id, @num
|
 |
|
|
PeterNeo
Constraint Violating Yak Guru
357 Posts |
Posted - 2007-09-10 : 01:56:29
|
| Yes(as of my knowledge), why do u want like this can u post u r stored procedure code. |
 |
|
|
chih
Posting Yak Master
154 Posts |
Posted - 2007-09-10 : 02:09:45
|
I don't have scripts, it is just one of my colleagues ask me. Thanks you!quote: Originally posted by PeterNeo Yes(as of my knowledge), why do u want like this can u post u r stored procedure code.
|
 |
|
|
Zoroaster
Aged Yak Warrior
702 Posts |
Posted - 2007-09-10 : 09:16:47
|
quote: Originally posted by chih Hi Zoroaster,Thank you. so there is no way we can use -@num in executing stored procedure statement.
Correct. Future guru in the making. |
 |
|
|
|
|
|
|
|