Skip to content

For databases with single log files, the sp_attach_single_file_db stored procedure will work to attach the DB file and create a new single log file. The syntax is as follows: sp_attach_single_file_db [ @dbname= ] ‘dbname’, [ @physname= ] ‘physical_name’ Where there are multiple log file, the above stored proc won’t work. You can still attach this…

Read More

For those of you unfortunate enough to still be running legacy applications from the cretaceous period, the below SQL 2000 Health Check script might help to sooth that itch a little… <span style=”font-size: 85%;”>create procedure sp_emailDailyHealthCheckCSV @charfrom varchar(50), @charsubject varchar(100), @charemailserver varchar(15), @intresults int OUTPUT AS /****************************************************************** * * DAILY HEALTH CHECK SCRIPT – SQL Server…

Read More

There’s a lot that can be said about what the correct ways are to split up a database over multiple disks, and on a windows system the advantages are fairly self evident when you consider that Windows only allows four (4) concurrent read / write operations per LUN. This article isn’t going to cover the…

Read More

Removing log shipping via SQL Management studio is as simple as un-selecting the log shipping check box under the database properties, however every now and again somebody restores a database over a DB that was configured for log shipping, consequently breaking everything and now requires a little manual intervention in order to get things cleaned…

Read More

SQL Server Dynamic Management Views (DMVs) are a powerful feature set introduced with SQL 2005 that allows you to pull back the curtain on SQL Server and easily review some of the inner workings of your database server (such as performance issues etc) without first having to collect a full SQL trace then interrogating that…

Read More

Identifying SQL Server performance bottlenecks can be quite a complicated process. With so many counters required to assess where potential bottlenecks exist – both within SQL Server, it’s databases and the underlying operating system, disk subsystem etc. Below we’ve listed just a handful of SQL Server Perfmon counters which you can use to assess some…

Read More

Whenever a database is moved from one SQL Server to another, it’s only the database users which are carried across (so no logins are transferred as part of this). For Windows logins, the fix is simply a matter of re-creating that login on the new server, however SQL logins – which have their own unique…

Read More

The following guide steps you through the process of setting up a SQL mirroring configuration between two servers on a work group (non-domain) environment, using certificate based authentication. The configuration below includes the setup of a witness server, however this can be omitted if no automatic fail-over is required (noting that a witness server can…

Read More

This was a pre-SQL 2012 solution (where Availability Groups would have been the obvious way to approach this problem) which involved a group of SQL databases in a mirroring configuration, whereby all databases needed to fail-over together in accordance to the active location of a specific database (in the example below, DBX) – essentially emulating…

Read More

Depending on requirements of the solution; we use asynchronous mode for performance reasons (which excludes the two-phase commit), and we use synchronous mode for data protection reasons. The below how to article will step you through the setup of both of these SQL mirroring solutions using T-SQL only. Note; when using the GUI to establish…

Read More