sysdatabases db_id

  • Hi All,

    I have a question i have a index stored procedure that populates user database table on name from sysdatabases table where db_id >4 is this true or bad practice?

    if one was to move system database to a different drive will they still keep the id's?

    Or should i just use where name not in ('blah') to avoid any mistakes.

    Cheers

  • The system DB ids are fixed (at least in the current versions of SQL)

    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
  • Cool, thanks for the info

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

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