Solved

Capturing SPID on linked server.

Posted on 2011-02-14
4
412 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Pivot with row total 5 30
RESTORE A BACKUP IN SQL 2012 from SQL 2008 9 67
RESTORE MASTER DATABASE -- NOW 2 20
Substring works but need to tweak it 14 17
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

821 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