[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1235
  • Last Modified:

SQL Server 2000 Exponent Operator

Is there no operator in SQL Server for exponent?  For example, 2 the power of 5 = 32.  Is there any way to calculate 2 to the 5th?  It doesn't seem like there is.

SQL Server offers this COLUMNS_UPDATED() function, and I'm trying to use it to see if the nth, and only nth column of my table has been changed, but I want to do it dynamically, and my understanding is that it is bit wise, so I need to 'AND' COLUMNS_UPDATED() with the value of 2 to the 5th power, or 32.  I can get my colorder dynamically, but I can't do 2 the power of the value of colorder.

Any ideas?
0
ejfmember
Asked:
ejfmember
  • 3
  • 2
1 Solution
 
jkorzCommented:
oops, good thing I checked the link, you want the POWER function in the list on the left
0
 
ptjcbCommented:
POWER
Returns the value of the given expression to the specified power.

Syntax
POWER ( numeric_expression , y )

Arguments
numeric_expression

Is an expression of the exact numeric or approximate numeric data type category, except for the bit data type.

y

Is the power to which to raise numeric_expression. y can be an expression of the exact numeric or approximate numeric data type category, except for the bit data type.

0
 
jkorzCommented:
what he wrote is verbatim from the link I posted
0
 
ptjcbCommented:
jkorz is right - this is from BOL (Power())
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now