Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

session id

Posted on 2010-08-27
7
Medium Priority
?
280 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 500 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 1500 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 18

Assisted Solution

by:Anil Golamari
Anil Golamari earned 1500 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 1500 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

877 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