question

Karthik M avatar image
Karthik M asked

limit of process id (SPID)

maximum limit of process id (SPID) in sql server 2008
sqlsql-server-2008-r2
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Usman Butt avatar image
Usman Butt answered
SQL Server generally returns SPIDs as smallint. So for us the maximum SPID would be 32,767. Hence, logically you can say 32,767 as the maximum. But I believe, behind the scene, it is in INT format which have 2,147,483,647 as the maximum. Is it an interview question?
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image Kev Riley ♦♦ commented ·
If that's an interview question, I don't want the job! :)
1 Like 1 ·
Usman Butt avatar image Usman Butt commented ·
I do not want that either :) But looking at the question's words and tone, it seems more like an online test/quiz etc. The lightning acceptance of answer compliments that as well. :) But I had a chance of giving an online pre-job test early in my carrier, and I was amazed by the questions asked. I had to get back and found that no direct information for those questions was available. I needed to derive it from BOL documentation or some system procedure internals.
0 Likes 0 ·
JoeHayes avatar image
JoeHayes answered
I actually came across this because I needed to cast a SPID to a character type, and didn't want to do something like varchar(max). This caused me to use varchar(10)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.