@@SPID is deprecated? What should replace this command in the new 2008 R2?

  • Hello,

    I am migrating from SQL 2005 to 2008 R2. Some stored procedures use the system function @@SPID, but I saw in the Books online a note that says:

    This is called the server process ID in earlier versions of SQL Server.

    Does it mean that this function has a replacement and should no longer be used? I know it still works, because I tested it, but I want to use the best practices for future compatibility. If there is any new command that substitutes this, what command is this?

    Thanks in advance,

    DBA Cabuloso

    Lucas Benevides

    ________________
    DBA Cabuloso
    Lucas Benevides

  • No, @@SPID is not deprecated in any way.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply