Solved

Capturing SPID on linked server.

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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.

757 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

20 Experts available now in Live!

Get 1:1 Help Now