Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change positive value to negative

I have Input parameter

@SMSSessionTimeout AS INT

Suppose @SMSSessionTimeout = 300

While using inside begin...end, I want to make it negative value. Like @SMSSessionTimeout = -300

Thanks in advance.

like image 724
jain ruchi Avatar asked Jan 13 '12 08:01

jain ruchi


People also ask

How do I flip negative and positive numbers in Excel?

Method 1 - Convert Negative Values to Positive Values You can use the "paste special" method to change numbers from negative to positive or positive to negative. Simply delete the -1 and you are done.


2 Answers

Multiply it by -1

SELECT @SMSSessionTimeout = @SMSSessionTimeout * -1;
like image 174
Paul Alan Taylor Avatar answered Oct 20 '22 03:10

Paul Alan Taylor


Prefix the value with a minus sign.

SET @SMSSessionTimeout = -@SMSSessionTimeout
like image 13
Anthony Faull Avatar answered Oct 20 '22 03:10

Anthony Faull