Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-09-04
4
Medium Priority
?
258 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 66

Assisted Solution

by:Jim Horn
Jim Horn earned 800 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 11

Assisted Solution

by:HuaMinChen
HuaMinChen earned 400 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 52

Accepted Solution

by:
Vitor Montalvão earned 800 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore 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.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

885 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