![]() |
|

Identify and resolve SQL Server problems before they happen
|
|
By: Jeremy Kadlec | Read Comments (2) | Related Tips: More > Deprecated Features |
Problem
In your recent tip (WARNING: SQL Server Deprecated Features) you have outlined a number of deprecated features. The listing with the mapping to the new code set is beneficial. Unfortunately I have an enterprise SQL Server environment and I need to be able to identify the deprecated features in more of an automated manner. We do not have the time to check all of our code (stored procedures, functions, etc.) and I know we have T-SQL embedded in middle tier and front end applications. How can I analyze this code in an efficient manner?
Solution
In any sized environment, identifying the deprecated SQL Server features could be a long and time consuming process. Luckily, Microsoft was thinking ahead and has events in Profiler that can be captured to identify the code with deprecated features. Let's take a look at how to capture the T-SQL code:
|
Launch SQL Server 2005 Profiler |
| Navigate to Start | All Programs | Microsoft SQL Server 2005 | Performance Tools | SQL Server Profiler.
|
|
Start a New Trace |
| Navigate to File | New Trace... | Authenticate to the SQL Server you want to monitor
|
|
General Tab - Configurations |
| Specify the name and configure the results to be saved to a table.
|
|
Events Selection Tab - Configurations |
| In order to review all events, enable the check box for 'Show all events' and 'Show all columns' on the bottom right of the screen.
Then navigate to the 'Deprecation' heading and enable the 'Deprecation Announcement' and 'Deprecation Final Support' events.
Once you have made these configurations or others as desired, then press the 'Run' button to begin the Profiler session.
|
|
Profiler Results - Deprecated Features |
| As an example, if you issue this command:
BACKUP TRAN <DatabaseName> WITH NO_LOG The results in Profiler will be:
|
|
Additional Analysis - Query the Results |
| SELECT * FROM <TableName> WHERE EventClass IN (125, 126); GO |
Next Steps
| Thursday, September 16, 2010 - 9:54:26 AM - Tony Henley | Read The Tip |
|
To be proactive, do you need to run profiler on the SQL Server version, to which you are migrating? (i.e you are on SQL 2008 and want to migrate to SQL 2008 R2, so you should run profiler on SQL Server 2008 R2?) |
|
| Thursday, September 16, 2010 - 11:50:52 AM - Admin | Read The Tip |
|
Tony, Good question. In this circumstance, you want to run the code on the SQL Server 2008 instance. Thank you, The MSSQLTips Team |
|
|
privacy | disclaimer | copyright | advertise | about authors | contribute | feedback | giveaways | user groups Some names and products listed are the registered trademarks of their respective owners. Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com |