SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to capture a SP embedded in a bespoke app


How to capture a SP embedded in a bespoke app

Author
Message
EamonSQL
EamonSQL
SSC-Addicted
SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)

Group: General Forum Members
Points: 498 Visits: 181
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
Sean Lange
Sean Lange
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: General Forum Members
Points: 64249 Visits: 17974
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.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
EamonSQL
EamonSQL
SSC-Addicted
SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)SSC-Addicted (498 reputation)

Group: General Forum Members
Points: 498 Visits: 181
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
Sean Lange
Sean Lange
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: General Forum Members
Points: 64249 Visits: 17974
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.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Lowell
Lowell
SSC Guru
SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)

Group: General Forum Members
Points: 74117 Visits: 40974
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!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search