SQL Server Drive Setup

The ideal database drives setup. Drive Use C: Windows OS System D: SQL Server, Database Engine, SQL Services X:\MSSQL\Data Data Files L:\MSSQL\Log Transaction Log Files I:\MSSQL\ Index Files T:\MSSQL\Data TempDB H:\MSSQL\Backup Backups

Database Types

Type Description Data Replication Transactional Used to record transactions as they come in from source. Yes Queue Used to queue data for processing purposes. Yes Staging Used to process data. Once the data is processed, the data can be discarded. No Data Staging Used to move/copy data from different environments. No Archive Used to store... » read more

Database Deployment Procedure

# Step 1 Pull latest version of code from respository and build database locally from scripts. 2 Disable all jobs and make sure no jobs are running on deployment database server. 3 Create database backups on deployment database server. 4 Apply “Alter” scripts. 5 Compare local databases with environment databases using “SQL Compare”. 6 Re-enable... » read more

Database Build Script

Database Folders Alter Alter sql scripts. Data Data sql scripts. DataTypes Data type sql scripts. DBScripts Create database sql scripts. ForeignKeys Foreign keys sql scripts. Functions Function sql scripts. Indexes Index sql scripts. PartitionFunctions Partition function sql scripts. PartitionSchemes Partition scheme sql scripts. Schemas Schema sql scripts. SQLJobs SQL job sql scripts. stbDDL Definition table... » read more

SSMS Tricks

Shortcuts Ctrl + C Copy Text Ctrl + V Paste Text Ctrl + X Cut Text Ctrl + A Select All Text Ctrl + W Select Word F5 Execute Query Ctrl + E Execute Query Ctrl + F Find Text Ctrl + H Replace Text Tab Increase Tab Shift + Tab Decrease Tab Ctrl +... » read more

Troubleshooting SQL Server

Log Files Job History Logs Database Server -> SQL Server Agent -> Job Activity Monitor -> Jobs -> View History SQL Server Logs Database Server -> Management -> SQL Server Logs Windows Event Viewer Windows -> Event Viewer

SQL Server Audits

Database Server -> Security -> Audits Database Server -> Security -> Server Audit Specifications Note: Make sure the audit file does not reach limit on 1) Number of Files 2) File Size Error 33206 – SQL Server Audit Failed to Create the Audit File SQL Server Audit failed to create the audit file ‘L:\ServerAudit\ServerAudit_EEFFB046-2AA7-4ACA-B91A-9F1FF5EF00EC.sqlaudit’. Make... » read more

Error 33206 – SQL Server Audit Failed to Create the Audit File

Error From Windows Event Viewer: SQL Server Audit failed to create the audit file ‘L:\ServerAudit\ServerAudit_EEFFB046-2AA7-4ACA-B91A-9F1FF5EF00EC.sqlaudit’. Make sure that the disk is not full and that the SQL Server service account has the required permissions to create and write to the file. Resolution: Change setting in the SQL Server Audit configuration or clear out files in... » read more

Database Fragmentation

The SQL Server Database Engine automatically modifies indexes whenever insert, update, or delete operations are made to the underlying data. Over time these modifications can cause the information in the index to become scattered in the database (fragmented). Fragmentation exists when indexes have pages in which the logical ordering, based on the key value, does... » read more