Query 1:
SELECT name, database_id, create_date FROM sys.databases ;
If u need only the User-defined databases;
Query 1: select * from sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb');
Query 2: SELECT name,filename ,sid FROM dbo.sysdatabases WHERE dbid > 4
SELECT name, database_id, create_date FROM sys.databases ;
If u need only the User-defined databases;
Query 1: select * from sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb');
Query 2: SELECT name,filename ,sid FROM dbo.sysdatabases WHERE dbid > 4
No comments:
Post a Comment