Solved

Capturing SPID on linked server.

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

920 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

15 Experts available now in Live!

Get 1:1 Help Now