3

I notice there are some numbering on the tab of each new query (such as the number 52, 56, 57 and 58 as shown in the following pictures)

enter image description here

What does these numbers means and is it possible to reset to the first original values?

2 Answers 2

4

The numbers represent the process id of the session associated with that tab - as every time you open a new tab it opens a new connection to SQL Server for you. They are not necessarily sequential but they can be. If you run the following command you should be able to see an entry for each of the tabs/connections that you have open:

select * from sys.dm_exec_sessions

I hope this helps you.

3
  • I close the tab completely but the new tab will have a number that is "plus 1" to the number of the close tab. So, wondering if there are other way to close the session (maybe by sqlcmd?)
    – Jack
    Commented Sep 11, 2012 at 9:50
  • I don't believe there is a way to control the process id that is assigned to a connection. Why would you want to? Commented Sep 11, 2012 at 10:53
  • The number that keep on growing make me tempted to reset to the original number. I just can't see why it is growing larger and larger even though I have close the tab. Also, I try to restart the instance inside the Sql server Configuration Manager but the number still grow (even though it have drop a few number). That's why I asked in my question if it is possible to reset the number or at least close as many sleeping or idle connection.
    – Jack
    Commented Sep 12, 2012 at 4:23
-1

select * from sys.dm_exec_sessions will return all of the sessions open on that particular sql server

The tab # is the # of your own session. Other user will receive their own session #.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.