Welcome to Aussie SQL Server Bloggers Sign in | Join | Help

SQL Server - Scripts (RSS)

SQL Server - Scripts

Which query is scanning that index?

SQL 2005's db_dm_index_usage_stats DMV allows DBAs to analyse how often indexes are being used (or not used), including individual counts for seeks, scans & lookups on each index in your database. I was thrilled when I first saw this DMV as there

update to usp_helpindexusagestats

Here's an update to the utility SP [usp_helpindexusagestats] I posted a few weeks back, in response to a comment from Mitch Wheat that he was receiving empty result sets, which could have occurred if the original version was run against a system with

Upgrade to [Measure database file i/o with fn_virtualfilestats (SQL2000 AND SQL2005)]

I'm up-grading a script I posted a few weeks back which measures i/o at database file level. Included in the new script are: (a) Physical O/S filenames(b) Physical O/S file volumes(c) A secondary, summary report of i/o, aggregated to volume level. Cheers,Greg
posted by Greg_Linwood | 0 Comments
Filed Under:

Measure database file i/o with fn_virtualfilestats (SQL2000 AND SQL2005)

I'm posting another admin script today which can be useed on either SQL Server 2000 or SQL Server 2005 to measure i/o behaviour against specific database files, using the fn_virtualfilestats() system TSQL function. This script is useful when you need
posted by Greg_Linwood | 0 Comments
Filed Under:

A simple SQL2000 Deadlock script

Analysing SQL Server deadlocks can be a tedious process. I'm currently working on a server that's experiencing a few & I wanted a script that could easily pull out the deadlock events from a sql error log, to save me from fishing between all of the
posted by Greg_Linwood | 1 Comments
Filed Under:

Relog utility script

I've been relogging (relog.exe) directories of perfmon counter files for years using a dusty old script when doing performance tuning assignments. Today I thought I'd pretty the script up for public consumption as my excuse for a reasonable blog entry.
posted by Greg_Linwood | 0 Comments
Filed Under:

Using column name prefixes

I was working on some database documentation for a customer recently & noticed something very handy about having columns named uniquely in a database which might be worth taking into consideration for your naming standards documentation. In the
posted by Greg_Linwood | 1 Comments
Filed Under:

Handy little sp_who2 script

I'm always hunting around for one of these scripts, so I'm sticking it here for ease of reference & in case its useful to anyone else.. select getdate()goif OBJECT_ID('tempdb..#spwho') > 0 drop table #spwhogocreate table #spwho (   SPID
posted by Greg_Linwood | 0 Comments
Filed Under:

Identify tables with identity columns but clustered index on other columns

I sometimes need to do this to work on re-indexing databases. WHY identity columns are perfect for clustered indexes is a big topic, but here's a query to help identify columns where clustered indexes are placed on OTHER columns... /********************
posted by Greg_Linwood | 0 Comments
Filed Under: