Solved

How to check SQL Query Status

Posted on 2011-03-02
4
511 Views
Last Modified: 2012-05-11
Hi,
can someone please help with a problem i've just encountered. I have a classic asp page which runs a query and then creates an excel file using outlook web components. The problem is the query is still running when the open file dialog box appears so the file created is incomplete. Does anybody know how to check the status of the sql query or how to issue a wait command?

thanks in advance
0
Comment
Question by:cmsRuncorn
  • 3
4 Comments
 
LVL 10

Expert Comment

by:cdebel
ID: 35017005
Check this link

(if you are using an MSSQL server)
0
 

Author Comment

by:cmsRuncorn
ID: 35017195
That's very helpful, thanks. But 1 question, how do i find out the current spid of the query so that i may check if the query is still running?
0
 
LVL 10

Expert Comment

by:cdebel
ID: 35017257
You can find it this way...  

SELECT @@SPID AS 'ID', SYSTEM_USER AS 'Login Name', USER AS 'User Name'
WHERE [Login Name] = 'YOUR LOGIN NAME HERE'

0
 
LVL 10

Accepted Solution

by:
cdebel earned 250 total points
ID: 35017289
Sorry....  pick this one instead.

SELECT @@SPID AS 'ID', SYSTEM_USER AS LoginName, USER AS 'User Name'
WHERE SYSTEM_USER = 'YOUR LOGIN NAME HERE'
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

820 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