SQL Server data types

Actually I have thought to write this post mainly for me as I always forget the differences of the different (yet similar) data types in SQL Server

Here is what I need to remember:

  • numeric is the same as decimal and they are both exact decimal values
  • float and real are approximate values
  • fLoat(n) complies with ISO SQL, n is the mantissa digits
  • [float(25) – float(53)] are stored in 8 bytes while [float(1) – float(24)] are stored in 4 bytes 
  • real is the same as float(24)
  • money is an exact decimal value stored on 8 bytes
  • nchar and nvarchar are the Unicode versions (2 bytes per character) while char and varchar use only 1 byte (so they can still accept UTF-8 characters but not UTF-16 like Japanese or Chinese)

That was some short notes, for the full details you can check

http://msdn.microsoft.com/en-us/library/ms187752.aspx

Advertisements