Solved

Capturing SPID on linked server.

Posted on 2011-02-14
4
405 Views
Last Modified: 2012-05-11
I am using  a linked server...

I am using openquery() to run a stored procedure on the linked server.

Is there any way in which I can capture the SPID of the stored procedure run through openquery() ...

I need to be able to do using TSLQ not profiler.
0
Comment
Question by:Mr_Shaw
4 Comments
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 34887007
Person have ability to share SQL objects for Link server. and you can access it like

select * from Linkserver.tablename
0
 
LVL 5

Accepted Solution

by:
spikelly earned 250 total points
ID: 34887077
First Run your query; Hthen while the query is running, run "sp_who" or "sp_who2" to capture the spid.
when executing "sp_who" you'll be able to find your stored procedure awith its SPID.
0
 
LVL 50

Assisted Solution

by:Lowfatspread
Lowfatspread earned 250 total points
ID: 34887205
you can include a

select @@spid

within the procedure to report which pid it ran under....
0
 

Author Closing Comment

by:Mr_Shaw
ID: 34900466
thanks
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

785 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