Solved

session id

Posted on 2010-08-27
7
266 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
Comment Utility
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
Comment Utility
0
 
LVL 6

Author Comment

by:anushahanna
Comment Utility
OK.

Like we have sys.sysprocesses for process id, what is the system view for session id?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 18

Assisted Solution

by:Anil Golamari
Anil Golamari earned 375 total points
Comment Utility
0
 
LVL 6

Author Comment

by:anushahanna
Comment Utility
so session id is same as process id?
0
 
LVL 18

Assisted Solution

by:Anil Golamari
Anil Golamari earned 375 total points
Comment Utility
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
Comment Utility
Thanks for the analogy.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

743 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

12 Experts available now in Live!

Get 1:1 Help Now