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 2000 Forums
 SQL Server Administration (2000)
 Renaming Datafiles

Author  Topic 

vaddi
Posting Yak Master

145 Posts

Posted - 2007-03-09 : 15:15:48
hello,

I have attached a test db from sql 2000 to production.

How can I change the name of the datafile and logfile.

On the test db I have the name abc_test_data and abc_test_log.
I need to change this to abc_data and abc_log on the production server.

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-03-09 : 15:19:33
I believe you would use ALTER DATABASE MODIFY FILEGROUP.

You probably will want to change the logical names too, so make sure to check out the MODIFY FILE option for ALTER DATABASE command in SQL Server Books Online.

Tara Kizer
Go to Top of Page

vaddi
Posting Yak Master

145 Posts

Posted - 2007-03-09 : 15:34:46
It says the file group doesnot exist.

I need to change the name of the data file from abc_test_data.mdf to abc_data.mdf .

And there is only 1 data file.

Thanks
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-03-09 : 15:40:31
I normally do this as part of the RESTORE into a new database.

See: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=RESTORE%20syntax%20/%20example

Kristen
Go to Top of Page
   

- Advertisement -