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
Solved

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

Posted on 2014-09-04
4
221 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 48

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Copy Database Wizard 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.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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