Monthly Archives: March 2013

Find connections to a database

Often DBAs need to delete old databases. As soon as I receive a list of databases that can be deleted the first thing I would check is if there are any active connections to the databases and know the spids … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , , | 6 Comments

Upgrade from SQL Server 2008 R2 SE SP1 to SQL Server 2008 R2 EE SP1

In this post the focus is on upgrading SQL Server 2008 R2 SE SP1 to SQL Server 2008 R2 EE SP1. Below are the screenshots that will guide you through the upgrade process. 1) In the first step, locate the SQL Server … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , | Leave a comment

SQL Server 2008 R2 RTM repair issue: sqlagtctr.dll file in use

In this post the focus is on fixing the SQL Server 2008 R2 RTM repair issue. I was trying to apply the windows server 2008 r2 sp1 patch on SQL Server 2008 R2 RTM and it errored out with the … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , , | 1 Comment

Script to identify when a user database was last accessed

Often DBAs get requests to identify when a database was last accessed in an environment.  These requests are more common in development or test environments where developers are making changes constantly and lose track of when a  specific change was … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , | Leave a comment

SQL Server Script to identify logical, physical CPU count for SS2K5 and higher database servers

In this post the focus is on identifying logical and physical cpu count for database servers with SQL Server 2005 and higher versions. The script uses the DMV  sys.dm_os_sys_info which is used to retrieve OS related information in SQL Server. This script was … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , , , , , , , | Leave a comment

SQL Script to identify when tables in a database were last updated

In this post the focus is on identifying when tables in a database were last updated. Although this can be acheived by adding a column to tables in a database with default constraint getdate() that updates the column value with the new date and time, … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , | Leave a comment

SQL script to lookup connection count

From a DBAs perspective it is always important to monitor the number of connections that are targeting the database from a specific session id. This can be achieved by joining the DMV’s sys.dm_exec_sessions and sys.dm_exec_connections. The interesting part of the … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , | Leave a comment