How to capture a SP embedded in a bespoke app

  • Hi,

    I'm looking after an application that runs a stored procedure created within the source code of the app.

    I'm guessing that each time you log on to the app the SP gets created somewhere or it creates on the fly.

    Is there a way to capture it's source code and see what it's doing?

    I don't have access to the app's source code.

    Any help welcome.

    Thanks,

    Eamon

  • Fire up sql profiler and run the app.

    Curious, how do you know it is a stored proc?

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Thanks for this.

    The reason I know is that this is an old app which the vendor isn't supporting anymore.

    Sometimes a data issue occurs and we've been told that a hard-coded SP inside the app is the issue.

    Yes, SQL profiler is the clear choice indeed but I figured I'd ask if it happened to exist in tempdb, syscomments or other places.

    Many thanks,

    Eamon

  • EamonSQL (8/1/2013)


    Thanks for this.

    The reason I know is that this is an old app which the vendor isn't supporting anymore.

    Sometimes a data issue occurs and we've been told that a hard-coded SP inside the app is the issue.

    Yes, SQL profiler is the clear choice indeed but I figured I'd ask if it happened to exist in tempdb, syscomments or other places.

    Many thanks,

    Eamon

    I doubt it would exist in tempdb unless they created the proc as a temp proc. I assume also that since you have access to the db the proc is not there after the program closes? I would assume the proc would exist on whatever database the rest of the application is using. Maybe it gets dropped when the application closes? Maybe this is not a proc at all and is instead hard coded pass through sql?

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • EamonSQL (8/1/2013)


    Thanks for this.

    The reason I know is that this is an old app which the vendor isn't supporting anymore.

    Sometimes a data issue occurs and we've been told that a hard-coded SP inside the app is the issue.

    Yes, SQL profiler is the clear choice indeed but I figured I'd ask if it happened to exist in tempdb, syscomments or other places.

    Many thanks,

    Eamon

    chances are the application is actually just executing TSQL code; going to the trouble of creating a TSQL procedure, executing that TSQL procedure , and then dropping that same TSQL procedure to hide it from view is not something you'd typically see.

    the default trace would show it occuring, since it's a DDL action, and any longer term trace you care to create would have it too.

    i think it's much more likely "procedure" is referencing a function/procedure/subroutine written in the applications programming code, and not what we think of as a "procedure" in the TSQL world.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply