Wednesday, September 29, 2010

SQL Server Configuration Manager Password Change Denied

This work around may help if you get an access denied error while changing the password of a SQL Server service account in SQL Server Configuration Manager:

- Select Browse on the account name entry and re-enter the server account name

You should now be able to change the password.

Thursday, September 23, 2010

Creating and Storing SQL Passwords

2 great free tools for creating and storing your SQL passwords are:

Creating passwords:
http://www.pctools.com/guides/password

Storing passwords:
http://keepass.info

Monday, September 6, 2010

SQL Server Best Practices Analyzer

Use the following links to download the appropriate SQL Server Best Practices Analyzer for your SQL Server installation.

The SQL Server Best Practices Analyzer will help you understand where your SQL installation differs from Microsoft best practices.

SQL Server 2008 R1 and R2 (June 2010) -  http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=0fd439d7-4bff-4df7-a52f-9a1be8725591

SQL Server 2005 (August 2008) - http://www.microsoft.com/downloads/details.aspx?FamilyId=DA0531E4-E94C-4991-82FA-F0E3FBD05E63&displaylang=en

SQL Server 2000 (April 2010) - http://www.microsoft.com/downloads/details.aspx?FamilyID=b352eb1f-d3ca-44ee-893e-9e07339c1f22&displaylang=en

Virtual Machine Performance Investigations

This link is a must view if you are investigating or implementing virtual machine performance monitoring:

http://www.msteched.com/2010/NewZealand/SVR313

Friday, August 20, 2010

SQL Server 2008 Query Memory Usage

You may see Hash or Sort warnings in the default trace output and this is typically caused by query memory pressure.

If you would like to know how much memory a query is using, then the DMV sys.dm_exec_query_memory_grants may be able to help you.

An example for using the DMV is shown below:

DECLARE @mgcounter INT
SET @mgcounter = 1
WHILE @mgcounter <= 5 -- return data from dmv 5 times when there is data
  BEGIN
     IF (SELECT COUNT(*)
          FROM sys.dm_exec_query_memory_grants) > 0
        BEGIN
                 SELECT *
                 FROM sys.dm_exec_query_memory_grants mg
                             CROSS APPLY sys.dm_exec_sql_text(mg.sql_handle) -- shows query text
                 -- WAITFOR DELAY '00:00:01' -- add a delay if you see the exact same query in results
                 SET @mgcounter = @mgcounter + 1
        END
  END

Monday, August 16, 2010

SQL Server 2008 sys.dm_os_ring_buffers timestamp column

I have used the below code in SQL Server 2008 to reveal the sys.dm_os_ring_buffers timestamp column in a friendly format. 

SELECT Dateadd(ms,-1 * ((si.cpu_ticks / si.ms_ticks) - rb.TIMESTAMP),
Getdate()) AS time_stamp,
rb.*
FROM sys.dm_os_ring_buffers rb,
sys.dm_os_sys_info si
ORDER BY time_stamp DESC