I’m reverse engineering a gigantic stored procedure. There are tons of BEGIN ENDs in it, not all indented properly, many levels deep, and I am having a heck of a time finding which BEGIN END pairs match each other.
Is there an easy way to find out which pairs match each other. I know in Visual studio you can jump from opening bracket to closing bracket with ctr+] and same thing in SSMS 2008. But I’m using 2005.
Any ideas?
In SQL Server 2005, ctrl+] still works for
}, it just doesn’t work forBEGIN END. SQL Server 2005 doesn’t distinguish between commented out brackets and uncommented brackets, so my solution was to replace allBEGINs withBEGIN/*{*/and allENDs withEND/*}*/.So I had something like this:
With that I was able to jump back and forth to the paired
BEGINandEND.Look out for
BEGIN TRANSACTIONcommands though, you don’t want them included in the replace.