Guidelines for Creating Indexes

Here’s a few guidelines to get started. Indexes should almost always be built on columns used as primary keys, foreign keys, or frequently used in query join and where clauses. Tables with frequent updates should have very carefully chosen indexes, since each additional index will dramatically reduce write speeds to the table. Very large and... » read more

RAID arrays

Instead of being a SQL Server capability, though,RAID is a feature of the hardware that powers the server. RAID stands for Redundant Array of Independent Disks, and it’s configured by the operating system. RAID arrays use multiple physical hard drives, provide increased disk read and write speeds, more data redundancy protection, or both. RAID 5... » read more

SQL Server Log Shipping

SQL Server Log shipping allows you to automatically send transaction log backups from a primary database on a primary server instance to one or more secondary databases on separate secondary server instances. The transaction log backups are applied to each of the secondary databases individually. An optional third server instance, known as the monitor server, records the history and status of backup and... » read more

Setting up SQL Server Replication

Replication is a set of technologies for copying and distributing data and database objects from one database to another, and then synchronizing between those databases to help maintain consistency of the data. Using replication, you can distribute data to different locations and even to remote or mobile users over local and wide area networks, dial-up... » read more

Move database files

In a nutshell, the three main steps involved in moving a database file to new location are: Set database to single user mode. Detach the database. Move database file to new location. Reattach the database by referencing the new location of the database file. Set database to multiple user mode. Note: There are 2 ways to... » read more

Copy-only backups

Copy–only backups are independent backup files that do not disrupt the regular Log Sequence Number (LSN) routine. This means that backup chains and restore sequences won’t be affected by the copy–only backup.  A copy-only backup is a SQL Server backup that is independent of the sequence of conventional SQL Server backups. Usually, taking a backup changes the database and affects how later backups... » read more

SQL Server Files and File Groups

At a minimum, every SQL Server database has two operating system files: a data file and a log file. Data files contain data and objects such as tables, indexes, stored procedures, and views. Log files contain the information that is required to recover all transactions in the database. Data files can be grouped together in... » read more

Installing SQL Server Best Practices

Highly recommend that you store all user databases, user database logs, and backups on a drive separate from the system drive. So in other words, if your SQL Server is installed on the C drive of a computer, you should be putting all of your data files on a separate drive, and the reason being... » read more

Repository Pattern

Provides an abstraction of data, so that your application can work with a simple abstraction that has an interface approximating that of a collection. Adding, removing, updating, and selecting items from this collection is done through a series of straightforward methods, without the need to deal with database. Allows your applications to perform CRUD-like operations.... » read more

Managed vs Unmanaged Code

Unmanaged code is compiled to machine code and therefore executed by the OS directly. It therefore has the ability to do damaging/powerful things Managed code does not. This is how everything used to work, so typically it’s associated with old stuff like .dlls. M Managed code is not compiled to machine code but to an intermediate language... » read more