April 1, 2005 at 2:09 am
Hi all,
I would like to know if it's possible to change the physical name to database.
Could be possible through master..sysdatabases?
April 1, 2005 at 5:40 am
sp_renamedb
April 1, 2005 at 6:02 am
Thanks, but with sp_renamedb only I can change the db logical name.
I refered to physical name (file name)
For example, the db name is db1 as logical name but the db files name are D:\Program Files\Microsoft SQL Server\MSSQL\data\db2.MDF and D:\Program Files\Microsoft SQL Server\MSSQL\data\db2.LDF
Weeks ago I renamed the db2 database to db1 database and now I want to create a new db with the name db2. I was doing DTS between databases.
Now, I can't do to create it because this file name exist in the master..sysdatabases tablechange.
Thanks again
April 1, 2005 at 7:17 am
alter database with MODIFY FILE option.
Check BOL for detail syntax.
April 1, 2005 at 4:55 pm
alter database modify file to change physical name only works on tempdb.
For others database detach and attach is a option.
sp_detach_db
rename the physical file
sp_attachdb with physical file specified.
April 4, 2005 at 3:00 am
Thanks wz700,
the method was right
October 13, 2006 at 10:51 am
Yes, thanks! this works... just what I needed, too!
Thank-you,
David Russell
Any Cloud, Any Database, Oracle since 1982
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply