Solved

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

Posted on 2014-09-04
4
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 50

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Format Date fields 11 65
array not updating 8 43
Put File 6 38
Easiest intro into .NET CORE? 2 34
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

710 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