Solved

Can I capture data from a temp table (MS SQL)

Posted on 2014-09-04
4
201 Views
Last Modified: 2014-09-05
We have a .Net application but are not privy to the source code.  This application makes use of a temporary table in an MS SQL database (2008, R2 soon to be upgraded).  The application drops the table upon completion of the routine.

Is there any way to capture the data from this table during its short life.  Since we cannot get to the source code, we cannot be in the same SQL session.  I suspect the answer is no, but want to leave no stone unturned.

Thanks.
0
Comment
Question by:g_johnson
4 Comments
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 200 total points
ID: 40305096
>This ( .Net ) application makes use of a temporary table in an MS SQL database (2008, R2 soon to be upgraded).
Ok, I'll bite.   Why the hell's that??

>Is there any way to capture the data from this table during its short life.
Local temp tables (prefixed with #)are ONLY in scope during the execution of the specific script that executes it (SP, function), so you can't access it from another session.   Global temp tables ## I believe can be accessed outside of the proc that created it, but I've never done that so you'll have to test it to be sure.
0
 
LVL 10

Assisted Solution

by:HuaMinChen
HuaMinChen earned 100 total points
ID: 40305124
The answer is no unless you can adjust the source codes to also put the recordset into one other permanent table.
0
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 200 total points
ID: 40305626
Only if they use a physical table during the process and drop it after. What I think is not the case but you can find it easily by running a SQL Profiler over the database and capture all SQL statements.
Even that you won't catch the data you'll catch the T-SQL code which can give you a good idea of what they are doing.
Imagine that they are loading data from another table, so you will be able to catch the SELECT that they are using for importing the data and then you can use it by yourself.
0
 
LVL 4

Author Closing Comment

by:g_johnson
ID: 40305735
Thank you all.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now