 | SQL Server Derived Tables Some result sets are difficult to extract from a database without performing multiple queries or using temporary tables and cursors, which can harm performance. Derived tables help with some problems by creating virtual tables within the scope of a query. |
 | SQL Server Transaction Savepoints Sometimes Transact-SQL (T-SQL) scripts require the ability to roll back some parts of a transaction whilst allowing other elements of a process to be committed to the database normally. This can be achieved with the use of transaction savepoints. |
 | Truncating Tables in SQL Server Deleting large amounts of data from a SQL Server table can be an expensive operation, in terms of transaction log space, memory usage and the creation of locks. When emptying a table completely, truncating the table can be a less expensive option. |
 | A SQL Server Leap Year Test Function Transact-SQL does not provide a standard function that allows developers to determine if a year is a leap year. This article describes two functions. One to calculate the number of days in a year and one that utilises the result to identify leap years. |
 | SQL Server Numeric Formatting Transact-SQL includes the Convert command that allows values to be converted between differing data types. When converting some numeric types to text, a style code may be applied. This code determines the formatting of the generated string. |
 | Hiding the SQL Server sa Login When SQL Server is installed, the "sa" login is created automatically. When using Windows-only authentication, this administrative account is disabled. With mixed mode authentication, the "sa" login can be a target for attacks. |
 | Disabling SQL Server Triggers Triggers can be applied to the tables in a SQL Server database so that actions are taken automatically when data is inserted, updated or deleted. In some situations it is necessary to disable triggers to allow data to be modified without their effects. |
 | Disabling SQL Server Table Constraints SQL Server databases should be configured with foreign key constraints to maintain referential integrity and check constraints to ensure that table data is always valid. Occasionally these constraints can be a hindrance and may be temporarily disabled. |
 | Inserting Only Table Defaults in SQL Server Some SQL Server database tables are designed with a default value or an identity specification for every column. If a row in such a table must only use the default values, a special syntax is required to allow an INSERT to be executed. |
 | T-SQL INSERT INTO SELECT and SELECT INTO A common task when using Transact-SQL (T-SQL) is to copy information from one table into another, possibly changing the data or its structure in the same operation. This can be achieved by combining the standard SELECT and INSERT commands. |