Re: Using Reflection to Dynamically Determine Stored Procedure Name

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



If you have access to the source code, there's no reason that you couldn't
just do a file system search. If that's true, I don't see the need to get
more elaborate. I've done the same thing for a body of source code that
amounts to several hundred thousands of lines of code, and it was no big
deal.

Tom Dacon
Dacon Software Consulting

"Tod Birdsall" <tbirdsall@xxxxxxxxx> wrote in message
news:963d26f3-17a6-4f8a-9c18-1f0c4e61d1e8@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

My boss has asked me to create a tool that can give us a list of
stored procedure names that are being called from each of our app's
web pages. This is an ASP.NET application that is rather large and
about 5 years old. I am not here to debate the logic of the request.

The structure of most the application is pretty standardized: We
created a business/data layer that contains methods that have the
names of the stored procedures to call as hard coded strings. The
stored procedures all begin with "USP_", so should be pretty easy to
ferret out.

My initial thought was to use reflection to start at the ASP.NET
assembly, then work my way down to the business/data layer assembly.
So the end report would tell you each namespace.class.method that
leads up to the proc and look something like:

-CompanyApp.Defaultl.aspx.cs.PageLoad()
--BizLayer.GetCustomerData()
---DataLayer.GetCustome()
----"USP_Customer_Get"


Has anyone tried to do anything like this before? Does anyone have any
suggestions on where to begin or can you point me to a tutorial on
something similar?

Thanks for any help you can provide.

Tod Birdsall
http://tod1d.net


.



Relevant Pages

  • Automatically migratring metadata between instances of SQL Server 2000
    ... straight from your source code. ... >(updated or new Stored Procedures and tables) from one ... >whether there is a good way of backing up the metadata ... how can I script the process of ...
    (microsoft.public.sqlserver.tools)
  • Re: How to call stored procedure using DBIx?
    ... The arbitrary-sql approach won't help since it writes sql statements in ... source code to act as stored procedures. ... Yet I don't know how to call my stored procedures directly using ...
    (comp.lang.perl.misc)
  • Re: Help needed to apply Source Control to Stored Procedures
    ... Where is the source code for the stored procedures? ... VS.NET to a database server (via a database project)? ... to enable source control for stroed procedures is greyed out and I cannot ...
    (microsoft.public.vsnet.setup)
  • Re: How to call stored procedure using DBIx?
    ... The arbitrary-sql approach won't help since it writes sql statements in ... source code to act as stored procedures. ... Yet I don't know how to call my stored procedures directly using ...
    (comp.lang.perl.misc)