PBM: Error evaluating script policies (ExecuteSql) against SQL Server 2000 - by Pedro Lopes (PL)

Status : 


Sign in
to vote
ID 807827 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 11/5/2013 5:14:47 PM
Access Restriction Public


Using SQL Server 2008R2 SP2 CU8 as the CMS from where PBM is also working against central managed servers, PBM outputs the following error when evaluating any policy based in a ExecuteSql() facet:

"Line 1: Incorrect syntax near 'max'.
Must declare the variable '@@UserScript'.
Must declare the variable '@@UserScript'. (Microsoft SQL Server, Error: 170)"

Doing a trace, this is the execution string:

DECLARE @@UserScript nvarchar(max); 
SET @@UserScript = N'<my t-sql condition>;';
EXEC sp_executesql @@UserScript;

The t-sql condition in the facet is valid, but the execution in SQL 2000 is invalid due to nvarchar(max).
Sign in to post a comment.
Posted by Pedro Lopes (PL) on 11/18/2013 at 8:30 AM
I am well aware that SQL 2000 is not supported anymore.
Nevertheless, at the very least, the appropriate incompatibility information between the ExecuteSql() facet and SQL Server 2000 should be added to a "Considerations for using Policy-Based Management" section in http://technet.microsoft.com/en-us/library/bb510667.aspx and http://technet.microsoft.com/en-us/library/bb510667(v=sql.100).aspx, given that SQL Server 2000 was overall supported by PBM.
Posted by Microsoft on 11/18/2013 at 8:12 AM
Hello Pedro. Thank you for your input. SQL Server 2000 is no longer supported in any context. You can find out more about support lifecycle of various iterations of SQL here: http://support.microsoft.com/lifecycle/search/default.aspx?sort=PN&alpha=sql+server&Filter=FilterNO