What is the vardecimal data type in SQL Server?


Databases grow rapidly every day. That is a simple fact. When we are in charge of administrating a large database, storage space is always a concern. We would like to know all these ways and techniques that will enable us to use our storage space as efficiently as possible.

A  new data type was introduced in SQL Server 2005 SP2(Service Pack 2 must be installed).We can use this new data type to reduce the size of a database.

It is called vardecimal. The vardecimal data type is used to store the Numeric/Decimal(data types with fixed precision and scale) data types. The vardecimal works the same way as the varchar works for the alphanumeric data. Basically it is a form of compression.Vardecimal data type can be very useful in a situation like this.

In some cases we can have have a decimal/numeric column with a precision scale (30,4), then each value will need 17 bytes of storage so…

Ver la entrada original 253 palabras más