Active Directory Groups for Easier Permissions Management

SQL Server supports two authentication mechanisms, namely Windows and Mixed Mode. In Windows Authentication only accounts created on the local machine or domain accounts (users, groups, etc.) can be granted access to the SQL Server instance. This is the preferred and recommended (by Microsoft and most DBAs) implementation since the... [Read More]

Generate RESTORE DATABASE command from an existing backup

Restoring databases is quite simple, especially if you’re using the GUI.  Just right-click on the Databases “folder” in SSMS, Choose the “Restore Database” option and the interface will prompt you for the database name, from where you want to restore, and other parameters.  I prefer scripting though.  One reason is... [Read More]

Script to generate CHECK Constraints

This is another in a series of “scripts that generate scripts”; in this post I will be covering CHECK constraints. A CHECK constraint basically verifies that the value of the column it is checking evaluates to TRUE when the logical statement defining up the constraint is executed.  The definition of... [Read More]

Database Mail failed to initialize - Unable to start mail session

After configuring Database Mail on a clustered SQL Server 2008 R2 instance using a script based on the Create a Database Mail profile in 4 Steps (or less) article, the test email was not delivered.  Some investigation showed that the email was actually not sent.  I also checked the Database... [Read More]