Microsoft SQL Server - Reference and Migration

Technical information on Microsoft SQL Server and its migration to other databases.

Last Update: Microsoft SQL Server 2012

SQL and Transact-SQL Language Elements

Data Types

SQL Server data types:

1 BIGINT 64-bit integer
2 DATE Date (year, month and day) Since SQL Server 2008
3 NCHAR(n) 1 ⇐ n ⇐ 4000 Fixed-length string in Unicode UCS-2
4 NVARCHAR(n) 1 ⇐ n ⇐ 4000 Variable-length string in Unicode UCS-2
5 NVARCHAR(max) 2 GB
6 TIMESTAMP and ROWVERSION Auto-updated binary
7 TINYINT 0 to 255 8-bit unsigned integer

Built-in SQL Functions

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

Statements

SQL and Transact-SQL statements:

Database Settings

How To - Transact SQL

SQL and Transact SQL

SQL Server Metadata

Database Administration (DBA) - Instances and Connections

SQL Server Performance