Using Temp Table

By using SELECT … INTO, you don’t have to define the columns of the temporary table. The temporary table columns will be based on the SELECT columns.

Create Database Backup using Maintenance Plans

Database Server -> Management -> Maintenance Plans -> Maintenance Plan Wizard After the Maintenance Plan has been created… You can edit the maintenance plan using SSMS. A database job will be created for each plan. Note: If you want to remove the backup files after a certain days, make sure you also select the Maintenance... » read more

Linked Server Login Timeout

Error: Linked server timeout after 10 seconds. TCP Provider: Timeout error [258]. [SQLSTATE 42000] (Error 258)  OLE DB provider “SQLNCLI11” for linked server “xxxxxx” returned message “Login timeout expired”. [SQLSTATE 01000] (Error 7412)  OLE DB provider “SQLNCLI11” for linked server “xxxxxx” returned message “Unable to complete login process due to delay in login response”. [SQLSTATE... » read more

AUTO_UPDATE_STATISTICS

The default option is ON. How do the statistics increase the performance of your SQL Server query execution? The statistical histograms are used by the Query Optimizer to choose the optimal query execution plan. If a query predicate contains a column with statistics, the Query Optimizer does not have to estimate the number of rows... » read more

Creating Linked Servers

Link Server with a Specific Name ARCHIVE -> MyDB03 ARCHIVE is the link server name. MyDB03 is the actual database server name. Sources: https://docs.microsoft.com/en-us/sql/relational-databases/linked-servers/linked-servers-database-engine?view=sql-server-2017

RPC and RPC Out option on a SQL Server linked-server

The first RPC setting is mainly for a legacy feature called Remote Server, which is documented here. http://msdn.microsoft.com/en-us/library/ms190187.aspx You probably will not be using remote servers in SQL Server 2005 -SQL Server 2014 versions. If you do happen to use “remote servers”, the RPC setting enables a certain security feature. Sources:

SQL Server DateTime Type

Data type Comments Time Only keeps track of nanoseconds in a day. There is no reference to a date.Is stored using between 3 and 5 bytes. Date Only keeps track of days, starting 01/01/01 to 31/12/9999.Takes 3 bytes for storage. SmallDateTime Can be used to store dates between 01/01/1900 and 06/06/2079.Also allow to keep track... » read more