Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Finding Real Dependencies Expand / Collapse
Author
Message
Posted Friday, December 5, 2003 12:00 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, June 23, 2014 1:09 AM
Points: 27, Visits: 20
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/spopovski/findingrealdependencies.asp


Post #18917
Posted Thursday, December 18, 2003 8:58 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, January 18, 2008 9:01 AM
Points: 1, Visits: 16
Overall I think this is a very good start.

One thing to keep in mind is that proc names can contain embeaded underscore characters (i.e. update_company), which when used in a LIKE match can cause problems unless they are properly escaped (i.e. _ becomes [_]). It is also valid to include statement terminators immediately after the proc name (i.e. exec run_me; )

With these two points in mind, I have updated the ad-hock query WHERE comparision to look like:

WHERE #T1.ProcText LIKE '%' + Replace(T2.DependOnProc,'_','[_]') + '[' + char(9)+ char(10)+ char(13)+ char(32) + char(59) + ']%'

(be sure to add back in the plus characters for string concatination between each of the substring elements above -- looks like the forum software doesn't like this...)




Post #90124
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse