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 these numbers representing?
The brackets are required if you use keywords, spaces, hyphens or special chars in the column names or identifiers. Using square brackets in SQL Statements allow the names to be parsed correctly.
In SQL syntax notation, curly brackets enclose two or more required alternative choices, separated by vertical bars. [ ] In SQL syntax notation, square brackets indicate an optional element or clause. Multiple elements or clauses are separated by vertical bars.
Those brackets are included so that SQL Server can correctly interpret queries that reference table or column names that include spaces or special characters. None of the tables or columns in this database actually include spaces, but the automatically generated scripts include the square brackets anyway.
With SSMSBoost jump between bracket pairs is performed with hotkeys: CTRL+SHIFT+UP is used to move the cursor leftwards to the opening bracket and CTRL+SHIFT+DOWN moves the cursor rightwards to the closing bracket.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With