Advertisements
Here is a table of the most commonly used data types in SQL Server
| Data Type | Description |
| Char() | Fixed length string, unused spaces get padded and eat up memory: size 0-255 |
| Varchar() | Variable length string, unused spaces don’t use memory: 8000 chars |
| Nvarchar() | Designed to handle Uni Code data (UFT-8): 4000 chars |
| nvarchar(max) | 536-870-912 characters |
| Text | Up to 2GB of text data |
| Identity(x,y) | Auto incrementing number with x being starting point and y = steps, so Identity(1,1) starts and1 and counts by 1 |
| INT | integer (whole number, no decimals) |
| Decimal(x,d) | floating point decimal number, x is size, d is number of places after the decimal |
| float(n) | floating precision number, Float(24) = 4-bytes, Float(53) = 8-bytes — float(53) is default |
| Bool or Boolean | Binary choice, 0 = False and 1 = True |
| Date | Date data type “YYYY-MM-DD” (if set to US settings) |
| DATETIME | datetime data type “YYYY-MM-DD HH:MM:SS” (if set to US settings) |
| TIME | Time “HH:MM:SS” |
| YEAR | year in for digit representation (ex 1908,1965,2011) |

