What is SIGN() ?

 Posted by Bhakti on 11/24/2009 | Category: Sql Server Interview questions | Views: 3952

SIGN() is used to determine whether the specified is positive, negative or zero. In case of positive, negative and zero it returns +1,-1 and 0 consecutively.

print sign(0) -- prints 0

print sign(10) -- prints 1
print sign(-10) -- prints -1

Sometimes before using SIGN(), you need to confirm you are passing numeric value as argument.
You can do this using, ISNUMERIC()

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response