开发者

What is the number in brackets on the tab label of a sql script in VS2010?

开发者 https://www.devze.com 2023-02-17 05:32 出处:网络
After connecting to the database with a sql source file, the tab shows the filename in the tab along with my windows user id and a number in brackets. Different script files have different values in t

After connecting to the database with a sql source file, the tab shows the filename in the tab along with my windows user id and a number in brackets. Different script files have different values in the brackets.

What are 开发者_StackOverflow社区these numbers representing?


Its the SPID (basically session ID) from your session in SQL server.

If you run the sp_who2 stored proc you can see more information.

It helps with working out tracing and killing any scripts you have that are causing problems.


That is the SPID, which nowadays uniquely identifies your user session on the server.

If you fired up SQL profiler you could filter operations by that number.

Note that you see that same number in SQL Management Studio at the top of query windows with active connections, and also down in the lower-right corner of your VS IDE.

SPID used to stand for Server Process ID, but now it's User Session ID.


Something similar shows up in SQL Server Management Studio, but it's not always the SPID. In my current SSMS sessions, for some reason, the number in parentheses matches the SPID for the sessions that are connected to the [master] database but none of them match for the sessions connected to other databases. The value returned from @@spid is the correct value, based on what I'm seeing in the results of sp_who2 and other monitoring tools (Idera SQLdm). The session number 76 in the example below does not currently exist.

What is the number in brackets on the tab label of a sql script in VS2010?

0

精彩评论

暂无评论...
验证码 换一张
取 消