THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Allen White

Tracking Deprecated Features

This week I'm in Brno, Czech Republic leading an App Compat seminar for Microsoft clients here, and one of the things we need to look for in their applications is the use of deprecated features. I was poking around the sys.os_performance_counters DMV and discovered the [sqlinstance]:Deprecated Features object and found that if your application uses a deprecated feature, SQL Server increments the appropriate counter.

For example, on my SQL Server instance INST03, I looked at the value for the use of the sysdatabases backward compatibility view using the following query:

select * from sys.dm_os_performance_counters
where object_name = 'MSSQL$INST03:Deprecated Features'
and instance_name = 'sysdatabases'

When I ran it the first time it returned the value of 2 in the cntr_value column. I then selected from that view, then ran the query again, and it returned 3.

If you're trying to track the use of deprecated features to eliminate them from your application, this is a quick and easy way to find which features (a) are deprecated and (b) your application is using.

Allen

Published Tuesday, May 26, 2009 7:03 AM by AllenMWhite

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Glenn Berry said:

This version of the query gives you a little more specific information

-- Look for deprecated features in SQL Server 2008

SELECT object_name, instance_name, cntr_value

FROM sys.dm_os_performance_counters

WHERE object_name = 'SQLServer:Deprecated Features' -- (Default instance) Alter this for named instances  

May 26, 2009 5:46 PM
 

AllenMWhite said:

Thanks, Glenn. Your recent blog post was great.

May 27, 2009 5:01 AM
 

DaljitS said:

This can be captured from from perfmon as well using following object:

SQLServer:Deprecated Features

May 27, 2009 1:01 PM
 

DaljitS said:

This can be captured from from perfmon as well using following object:

SQLServer:Deprecated Features

For more information, have a look at

ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_4deptrbl/html/e95de9d6-c950-41cd-8aaa-be529c6de198.htm

or

http://technet.microsoft.com/en-us/library/bb510662.aspx

May 27, 2009 1:06 PM
 

mbourgon said:

Reminder that this is 2008 and higher only; 2005 doesn't seem to have it.

May 15, 2012 3:28 PM

Leave a Comment

(required) 
(required) 
Submit

About AllenMWhite

Allen White is a consultant and mentor for Upsearch Technology Services in Northeast Ohio. He has worked as a Database Administrator, Architect and Developer for over 30 years, supporting both the Sybase and Microsoft SQL Server platforms over that period.

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement