Always On Availability Group Configuration

By default both read-write and read-intent access are allowed to the primary replica and no connections are allowed to secondary replicas of an Always On availability group.  Permissions Task Permissions To configure replicas when creating an availability group Requires membership in the sysadmin fixed server role and either CREATE AVAILABILITY GROUP server permission, ALTER ANY AVAILABILITY GROUP... » read more

@@ServerName

Get the actual server name of the current SQL Server. Useful when you are using listeners to connect into SQL Server and need to know the exact server name you are connected into.

SQL Server Sequences

In SQL Server, you can create an autonumber field by using sequences. A sequence is an object in SQL Server (Transact-SQL) that is used to generate a number sequence. This can be useful when you need to create a unique number to act as a primary key. Creating sequences. Using sequences. Drop Sequences Properties of... » read more

User Defined Table Types in SQL

So what actually are User defined table types in SQL server? The easiest way to appreciate their value is to think of them as a strongly typed temporary table definition that has the added ability to be passed to a stored procedure as a parameter. Once used in a procedure or function can’t be altered... » read more

Moving TempDB To Another Drive

Because tempdb is re-created each time the instance of SQL Server is started, you do not have to physically move the data and log files. Remember to restart SQL Server after you run the move script for the changes to go into effect. Determine the logical file names of the tempdb database and their current... » read more