Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Renaming while attaching

Author  Topic 

sbarrack
Starting Member

1 Post

Posted - 2007-04-26 : 19:38:24
I am using SQL Server Management Studio with SQL Server 2005. On my development SQL server, I have developers using a database named TestData. An off-site developer has sent new versions of TestData.MDF and TestData.LDF. I want to attach this new database to the same development server for testing, without overwriting the existing database in use by the developers. How can I rename this new TestData to something like TestDataNew while attaching it? I only have the MDF and LDF files.

Thanks.

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-04-26 : 19:43:02
You have the option to give a different name while attaching it. You can either rename the files to TestDataNew.mdf and TestDataNew.ldf and try attaching it too.
And I dont think SQL Server will let you attach with the same name as an existing DB.


************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-04-26 : 19:43:28
Just rename the files then attach with a new name. The sp_attach_db command can use a new name as can the GUI attach.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -