Solved

How to check SQL Query Status

Posted on 2011-03-02
4
509 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

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

939 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

5 Experts available now in Live!

Get 1:1 Help Now