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)
 Rename logical database name

Author  Topic 

CanadaDBA

583 Posts

Posted - 2005-08-30 : 14:43:55
I want to rename logical database name but the following doesn't let me do that. Do you have any alternative?


EXEC sp_Configure @ConfigName = 'allow updates', @ConfigValue = 1
RECONFIGURE WITH OVERRIDE
GO

UPDATE SysFiles SET name = 'MyDB_data' where name = 'TestDB_dat'
GO
UPDATE SysFiles SET name = 'MyDB_log' where name = 'TestDB_log'
GO

Exec sp_Configure @ConfigName = 'allow updates', @ConfigValue = 0
RECONFIGURE WITH OVERRIDE
GO


Canada DBA

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-08-30 : 14:49:30
I haven't had to manually update the system tables in over 5 years now. There is always a way around that.

For this, you can use ALTER DATABASE.

Tara
Go to Top of Page

SQLServerDBA_Dan
Aged Yak Warrior

752 Posts

Posted - 2005-08-30 : 15:21:28
The alter db should go something like this:

Alter Database TestDB
modify file (name = testdb_log, newname = mydb_log)

Daniel
SQL Server DBA
www.dallasteam.com
Go to Top of Page

CanadaDBA

583 Posts

Posted - 2005-08-30 : 15:59:22
Most of the time, BOL doesn't provid exact short cut to an specific problem. Then these forums come and provide a hint or clue! Your reply solved my problem.

Thanks Tara!

quote:
Originally posted by tduggan

I haven't had to manually update the system tables in over 5 years now. There is always a way around that.

For this, you can use ALTER DATABASE.

Tara



Canada DBA
Go to Top of Page
   

- Advertisement -