Find user databases in SQL 2005

  • What is the easiest way to tell if a database is not a system database in SQL 2005. What would be a select that would give me this info for a script, I have looked at sys.databases and can not see a column that states this, may be missing it though?

  • Hi,

    U can check two views sys.databases and sys.sysdatabases then u can easly notice that there 6 sysdatabases given id as 1 to 6 and else are userdefined databases.

    So can use 1 to 6 db_id as system databases.

    HTH

     

    from

    Killer

  • Thanks, I will take a look.

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

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