Solved

session id

Posted on 2010-08-27
7
267 Views
Last Modified: 2012-05-10
how can i find out the current session id of the SSMS window I  have open?

Each new window is a diff session id?

If I have
SELECT GETDATE()
GO
SELECT GETDATE()

Will it the same session id for both select statements?

Thanks
0
Comment
Question by:anushahanna
  • 3
  • 3
7 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 125 total points
ID: 33543372
each window is a new connection, which is a new session (new session id)
0
 
LVL 18

Assisted Solution

by:Anil Golamari
Anil Golamari earned 375 total points
ID: 33543439
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33544441
OK.

Like we have sys.sysprocesses for process id, what is the system view for session id?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 18

Assisted Solution

by:Anil Golamari
Anil Golamari earned 375 total points
ID: 33544647
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33544769
so session id is same as process id?
0
 
LVL 18

Assisted Solution

by:Anil Golamari
Anil Golamari earned 375 total points
ID: 33545804
There is not really any connection between the SPID and the connection
string, not more than between a car and a petrol station. The connection
string only specifies you connect to SQL Server.

However, an instance of a connection object in ASP .Net maps to a spid in
SQL Server. If you open Task Manager in Windows, you will see a number of
processes that all have a PID (process id). Spids in SQL Server are
locigally the same: process ids, but within SQL Server.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33558075
Thanks for the analogy.
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

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

914 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

16 Experts available now in Live!

Get 1:1 Help Now