Sunday, March 11, 2012

Apply folder structure in SQL Server 2005

I am in the midst of the process of migrating mdb databases to SQL Server.

Since I have many databases, I want to organize them in a structured tree order, i.e. in folders and subfolders, like the example of "System Databases" folder.

Is it possible? and if the answer is yes, then how?

Any database can be moved to any location which is permitted to the domain account MSSQL is running under . Maybe it's tricky a little for the system databases master and tempdb; anyway all the information can be found on MSDN or BOL. To move user databases see sp_detach_db/sp_attach_db and http://search.msdn.microsoft.com/search/results.aspx?view=msdn&qu=moving+master+database for system db's.|||

I presume you mean you want to group them into folders in the GUI. Antoher poster assumed you meant you wanted to move the MDF/LDF files on the file system.

If you're talking about the GUI, the answer is "no" today.

This is not really a work-around, but FYI - it is possible to add extended properties to databases and then write a TSQL query that groups and sorts by the extended property value. In other words, it is possible to define your own database-level attributes and then sort and filter on them.

No comments:

Post a Comment