Article ID: 2587511 - View products that this article applies to.
Microsoft distributes Microsoft SQL Server 2008 R2 Service Pack 1 (SP1) fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security updates that were included with the previous SQL Server 2008 R2 Service Pack 1 (SP1) update release.
When a SQL Server performance condition alert is raised in Microsoft SQL Server 2008 R2, you might receive the following error message:
Additionally, the error message is logged in the SQL Server Agent error log in this situation.
Msg 512, Level 16, State 1, Procedure sp_sqlagent_get_perf_counters, Line 40
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Note This issue also occurs in Microsoft SQL Server 2008.
This issue occurs because the subquery of the msdb.dbo.sp_sqlagent_get_perf_counters system stored procedure calculates the value of a counter incorrectly.
The subquery lacks an inner join relationship for the [object_name] column in the condition of the subquery. Therefore, multiple rows are incorrectly returned, and the issue that is mentioned in the "Symptoms" section occurs.
Note The msdb.dbo.sp_sqlagent_get_perf_counters system stored procedure runs when a SQL Server performance condition alert is raised.
Cumulative update information
Cumulative update package 3 for SQL Server 2008 R2 SP1The fix for this issue was first released in cumulative update package 3. For more information about how to obtain this cumulative update package for SQL Server 2008 R2 SP1, click the following article number to view the article in the Microsoft Knowledge Base:
2591748Note Because the builds are cumulative, each new update release contains all the hotfixes and all the security updates that were included with the previous SQL Server 2008 R2 SP1 update release. We recommend that you consider applying the most recent update release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/2591748/ )Cumulative update package 3 for SQL Server 2008 R2 SP1
(http://support.microsoft.com/kb/2567616/ )The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 SP1 was released
To work around this issue, update the subquery of the msdb.dbo.sp_sqlagent_get_perf_counters system stored procedure. To do this, add the following condition to the WHERE clause of the four subqueries that are used in the [value] column calculation:
After you add the condition, the subqueries resemble the following:
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Article ID: 2587511 - Last Review: October 17, 2011 - Revision: 1.0
Contact us for more help
Connect with Answer Desk for expert help.