ROUND Function in SQL Server 2008 Function

In this article i described ROUND function in SQL Server 2008.
  • 2741

Introduction

ROUND Function rounds the given expression to a specific length. It is one of the MATH function available in SQL Server. Basic syntax for using ROUND function is given by:

Syntax:

ROUND (numeric_expression, length)

where,

numeric_expression- It is the expression which is to be rounded off.

length- It defines the length up to which the numeric_expression is to be rounded off.

Example:

Lets take some values and find result after applying ROUND function on them.

select 6 as value, ROUND(6,1) as AfterRoundedOff
select -14 as value, ROUND(-14,1) as AfterRoundedOff
select 12.05 as value, ROUND(12.05,1)as AfterRoundedOff
select 12.05 as value, ROUND(12.05,2)as AfterRoundedOff
select 0.3457653 as value, ROUND(0.3457653,1)as AfterRoundedOff

Now select whole code and press F5 to execute queries.

Output:

 Round_Function-in-sql.jpg

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.