473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Getting the SPID of a SqlConnection

Is there a way to get the SPID at runtime (the server-side
connection/process ID, which you can see in the
management/current_activity/process_info area in Enterprise Manager) from an
active SqlConnection object? I have found zero related info in help, object
browser, or the API viewer. Is getting it directly impossible?

Paul
Nov 21 '05 #1
2 4529
The query "select @@spid" should do it.

"Paul" <no***@executespammers.org> wrote in message
news:Ok**************@TK2MSFTNGP14.phx.gbl...
Is there a way to get the SPID at runtime (the server-side
connection/process ID, which you can see in the
management/current_activity/process_info area in Enterprise Manager) from
an
active SqlConnection object? I have found zero related info in help,
object
browser, or the API viewer. Is getting it directly impossible?

Paul

Nov 21 '05 #2
D'oh... forgot to look in SQL BOL. Thanks :)

Paul

"Marina" <so*****@nospam.com> wrote in message
news:eR**************@TK2MSFTNGP12.phx.gbl...
The query "select @@spid" should do it.

"Paul" <no***@executespammers.org> wrote in message
news:Ok**************@TK2MSFTNGP14.phx.gbl...
Is there a way to get the SPID at runtime (the server-side
connection/process ID, which you can see in the
management/current_activity/process_info area in Enterprise Manager) from an
active SqlConnection object? I have found zero related info in help,
object
browser, or the API viewer. Is getting it directly impossible?

Paul


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Travis L. Alltop | last post by:
Is there an easy way to do this? I can see the SPID on SQL but its hostname is just the Metaframe Server, and that does not tell who it belongs to on that server when there is multiple users on...
2
by: Developer98115 | last post by:
I need help getting schema information from an existing SQL Server database. My thought was that you could use ADOX via InterOp. Has anyone done this successfully and how? I have created a...
1
by: Matik | last post by:
Hello 2 all, Maybe my question can be very stupid, but I'm a little confused. When I run sp_who on my database, I see one process (accessing remotely my database from another database on another...
2
by: JimLad | last post by:
Hi, In an existing ASP/ASP.NET 1.1 app running on IIS 6, I need to RELIABLY pass the logged in username through to the SQL Server 2000 database for auditing purposes. The current method is...
1
by: Absinthe | last post by:
I am seeing intermittent blocking problems. The strange part of it is, that the SPID listed in the Blk By column is the same as the SPID that is being blocked. Has anyone seen this before, or...
3
by: wjreichard | last post by:
OK ... I am using UPS Worldship that issues an ODBC query to my MS2K server ... Worldship can query either a table or a view and retreive shipping info for a supplied orderid. I need to create a...
0
by: manicmax | last post by:
Hey I have a question for u I am taking connection string from IIS like this readonly string dataSource3 =ConfigurationManager.ConnectionStrings.ConnectionString; and using this dataSource3 ...
7
by: =?Utf-8?B?S2plbGwgQnJhbmRlcw==?= | last post by:
Is there a way to get unique @@SPID to database when programming solutions for IIS in ASP. When trying I realize that the actual client/user against MSSQL database is IIS, not the currently...
1
by: Yoda | last post by:
Hi, which is the syntax for a stored procedure that return to me the exact @@SPID of my current connection? I'm using ADO in VB6 and i want to obtain @@SPID Thank u Rob
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.