Datetime data types:
1 | DATE | Date (year, month and day) | Since SQL Server 2008 |
Other data types:
1 | BIGINT | 64-bit integer | ||
2 | NCHAR(n) | 1 ⇐ n ⇐ 4000 | Fixed-length string in Unicode UCS-2 | |
3 | NVARCHAR(n) | 1 ⇐ n ⇐ 4000 | Variable-length string in Unicode UCS-2 | |
4 | NVARCHAR(max) | 2 GB | ||
5 | TIMESTAMP and ROWVERSION | Auto-updated binary | ||
6 | TINYINT | 0 to 255 | 8-bit unsigned integer |
Built-in functions in SQL Server:
1 | DATEDIFF(units, start, end) | Get datetime difference in the specified units |
2 | @@ERROR | Get last error code |
3 | LEFT(string, n) | Return n leftmost characters from string |
4 | RIGHT(string, n) | Return n rightmost characters from string |
5 | RTRIM | |
6 | STR(float, len, decimal) | Convert float to string |
7 | YEAR(datetime) | Extract year from datetime |