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

Dynamic Management Views are a great way to peak under the covers of SQL Server to see what’s going on without having to run a full profiler trace and parse that through SQL tuning advisor. While the following is also available as a Performance Dashboard report, sometimes it’s handy to have the actual DMV query…

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

SQL Server is one of the most common attack surphases for would-be hackers, so it’s important to maintain a good security practices over the logins which have access into your environment. The following script checks your SQL Server for any accounts which do NOT have any databases mapped to them. While this isn’t a conclusive…

Read More