October 31, 2007 at 10:08 am
How to determine if the database is a master, model, msdb using DMO or programatically using some property or status and not by comparing the names.
October 31, 2007 at 10:13 am
Look for database_id
--Ramesh
October 31, 2007 at 10:18 am
Does the database_id remains same for any version of sql like 2000, 2005, 2007. Is this the best way or is there any propery which says that this is master, model or msdb.?
master1
tempdb2
model3
msdb4
Kiran
October 31, 2007 at 12:11 pm
I could be wrong but I belive that is the case. Every server I've looked at (more than 20 over 2000 and 2005) has those values for the system DBs.
Kenneth Fisher
Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]
October 31, 2007 at 12:22 pm
Yes the dbid remains same for all version
Regards..Vidhya Sagar
SQL-Articles
October 31, 2007 at 3:22 pm
EXCEPT for distribution 😉
* Noel
November 29, 2007 at 10:46 pm
Try this ..
Select * from sysdatabases .
The Compatibility level cmptlevel is different for 2000(80) and 2005 (90) sysdatadases.
🙂
"More Green More Oxygen !! Plant a tree today"
November 29, 2007 at 11:16 pm
Hi,
You can use the following query :
USE Master
select * from sysdatabases
to identify the current set of databases exiting on your sql server..
Rgds
Avaneesh.
"The severity of itch is inversely proportional to the ability to reach it" :))
November 29, 2007 at 11:30 pm
u can try database_id
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply