• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 450
  • Last Modified:

Capturing SPID on linked server.

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
Mr_Shaw
Asked:
Mr_Shaw
2 Solutions
 
Alpesh PatelAssistant ConsultantCommented:
Person have ability to share SQL objects for Link server. and you can access it like

select * from Linkserver.tablename
0
 
spikellyCommented:
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
 
LowfatspreadCommented:
you can include a

select @@spid

within the procedure to report which pid it ran under....
0
 
Mr_ShawAuthor Commented:
thanks
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now