Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 456
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

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