Monthly Archives: November 2011

How to restore a database when you have a SQL Server backup file?

Oftentimes, when I get a database backup file, I usually perform a quick database restore without any hesitation. This usually works fine, but sometimes I get an annoying error message without any clue. Actually, SQL Server provides some commands that … Continue reading

Posted in Backup & Restore, Database Engine | Tagged , , , , | Leave a comment

How to attach a database without log file (.ldf)?

Earily this morning, I was asked about how to attach a database without the lof file (.ldf). This may happen if someone drop the (.ldf) file incorrectly. For SQL Server 2005 or later, this can be eaisly done via both … Continue reading

Posted in Database Engine, Detach & Attach | Tagged , | Leave a comment

SQL Server database CHECKSUM page varify option

In SQL Server 2005, there is a new page varify option, CHECKSUM, which can detect the page corruption between time a database page is written to disk and read from subquently by SQL Server. This option (CHECKSUM) is more restricter … Continue reading

Posted in Database Engine, Database Options | Tagged , | 1 Comment

Tips: Avoid single-use cached plan with ‘optimize for ad hoc workloads’ in the SQL Server 2008 or later

In SQL Server 2008, there is a new server configuration option introduced, called ‘optimize for ad hoc workloads’. This option can improve the efficiency of the plan cache for single use ad-hoc queries (or called dynamic SQL). When this option … Continue reading

Posted in Database Engine, Script Library, Tips & Tricks | Tagged , , | 1 Comment