Wednesday, January 18, 2012

system database or a user database

Diff  System and User Databases in SQL-Server



The query bellow returns whether the DB is a system database or a user database.



SELECT name,CASE WHEN name IN ('master','model','msdb','tempdb')
THEN 1 ELSE is_distributor END is_system_database FROM sys.databases





No comments: