Solved

session id

Posted on 2010-08-27
7
270 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run Stored Procedure uisng ADO 5 22
SQL 2012 clustering 9 13
Setting variables in a stored procedure 5 22
Loops in SQL server code 4 21
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to shrink a transaction log file down to a reasonable size.

830 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