Home > SQL Server > @@Max_Precision – SQL Server

@@Max_Precision – SQL Server


@@Max_Precision – This function returns the max precision value set in the SQL Server for the decimal and numeric data types. The default value of maximum precision in SQL Server 2012 is 38. In older version, maximum precision value may be 28. The return data type of this function is tinyint.

Implementation

Executing the function @@MAX_PRECISION to get maximum precision set in the server currently

pic2

Precision is the total numbers stored in the decimal or numeric variable or column and the scale is number of digits on the right side of the dot(.). For instance,

pic1Experiment

Get the precision and scale value using SQL_VARIANT_PROPERTY function

pic3

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: