John Sansom – SQL Server DBA in the UK Rotating Header Image

Posts under ‘SQL Server Tips’

Simplify Your DBCC CHECKDB Output

If you’re a SQL Server Database Administrator and you don’t know what CHECKDB is then you need to stop whatever it is your are doing right now and read this. Seriously, just go ahead and do it now. It will only take you ten minutes to get to grips with the basics and it could [...]

With Great Advice Comes Great Responsibility

I know that you have seen it yourself too. That forum or blog post that contains “advice” that is daft, stupid or worst of all just plain wrong. The SQL Server community is an awesome phenomena. Through collaboration and collective contribution across a wide variety of channels, the community empowers it’s members to become better [...]

SQL Snippet: Who owns that SQL Server Job?

Here is a handy T-SQL script that will list all SQL Server Agent Job owners by job. From an administration perspective, this query can come in handy when you need to ensure/validate the job owners on your server. One common mistake that I have seen is that when a user creates a new SQL Server [...]

Top 10 Junior DBA Interview Tips

The start of a new year is a time for self reflection and along with it perhaps a desire to do something new with your career. Maybe you are considering becoming a Junior Database Administrator (DBA)? Acquiring your very first role as a Junior DBA is no easy feat. Just browse any one of the [...]

SQL Snippet: What SQL Server Agent Jobs were running at that time?

Here is a SQL Snippet that can be used to identify the SQL Server Agent Jobs that were running on a server at a particular point in time. This can come in very handy if you need to troubleshoot a performance issue after the fact and want to find out if there were any jobs [...]

SQL Snippet: SQL Server Wait Types

Here is a handy little SQL Snippet that will return information about those all important SQL Server Wait Types for your server. It uses the SQL Server Dynamic Management View (DMV) sys.dm_os_wait_stats in order to extrapolate the desired information. A column has also been added to provide details of the percentage of total wait time [...]

SQL Server Reporting Services Tip: email subscription tweak

What’s the problem? How to configure SQL Server Reporting Services 2005 to permit users to assign the delivery email address for their own subscriptions. Why does SQL Server work this way? When you subscribe to a report, the e-mail delivery settings you work with vary depending on whether your Role includes the “Manage individual subscriptions” [...]

Top 5 SQL Server Forums

As you no doubt already know, there is a ridiculously large amount of SQL Server Information available out there on the internet. Whether you’re browsing forums, web sites or blogs, knowing what the best sources of SQL Server information are and more importantly which one’s you can trust, can be tricky. So to help you [...]

Solutions to common T-SQL problems

Some of the moderators over at the MSDN SQL Server Forums have got together and collated a reference of solutions to common T-SQL problems. As always, all quality resources get added to the SQL Server Resrouces area of this site.

Generate a random number in SQL Server

What is the best way to efficiently generate a random number in SQL Server? One of my favourite SQL Server authors, Michelle Ufford recently posted her method for generating a random number, in the post Random Number Generator in T-SQL. This got me thinking and I decided to do a little investigation of my own [...]