Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server OCT2DEC function


 
Updated: 27 August 2010

Use OCT2DEC to convert an octal number to decimal.
Syntax
SELECT [wctEngineering].[wct].[OCT2DEC] (
   <@Number, nvarchar(4000),>)
Arguments
@Number
is the octal number you want to convert. @Number cannot contain more than 10 characters. The most significant bit of @Number is the sign bit (30th bit from the right). The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation. @Number is an expression of type nvarchar or of a type that can be implicitly converted to nvarchar. 
Return Types
float
Remarks
·         If @Number is not a valid octal number, OCT2DEC returns an error.
Examples

select
wct.OCT2DEC(54)

This produces the following result
----------------------
44
 
(1 row(s) affected)


select
wct.OCT2DEC(7777777533)

This produces the following result
----------------------
-165
 
(1 row(s) affected)


Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service