Solved

SQL Server Stored Procedure code compiled

Posted on 2014-03-25
3
496 Views
Last Modified: 2014-03-26
I am using SQL Server 2005 on a system using many stored procedures.
A standby server has the same stored procedures by due to on-going maintenance it may be possible that changes in the main server may not have been updated in every case.
Is it possible to compare the compiled stored procedure compiled code in the main server with the same stored procedure compiled code in the standby server ?
There may be differences in the source code due to varying comments so a textual comparison may yield false differences in functionality.
0
Comment
Question by:alcindor
  • 2
3 Comments
 
LVL 32

Expert Comment

by:bhess1
ID: 39954599
There are a few tools that may do what you need.

The most commonly used tool for this is a paid one - Red Gate's SQL Compare.  It is pricey, but good.  You may be able to kludge up a free version using two tools from Red Gate's free tools - Red Gate Scream (small tool to compare two Compare snapshots), and Red Gate Snapper (small tool to take a snapshot of a DB).

OpenDBDiff (at http://opendbiff.codeplex.com/) looks interesting and seems to do what you are asking for as well.  It is open source and free.

Also the Toad for SQL Server Freeware edition should be able to do this.  You can find it at http://www.toadworld.com/m/freeware/default.aspx

Hopefully, one or more of these will do what you need.
0
 
LVL 32

Accepted Solution

by:
bhess1 earned 500 total points
ID: 39954602
As far as I know, a comparison of compiled code (1) is not currently possible, and (2) could also result in inaccurate comparisons, because of different execution plans when compiled (which does happen, more often than you would think).  If one of the tools above allows you to exclude comments in the comparison, that should do the trick.
0
 
LVL 2

Author Closing Comment

by:alcindor
ID: 39955775
Thanks for your comments, I will check out the links supplied.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now