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.
| Author |
Topic |
|
Paul_Russ
Starting Member
5 Posts |
Posted - 2006-12-31 : 11:54:25
|
| Hi,This is my first posting to this forum. I'm trying to I'm trying to change the name of my database from ASPNET.mdf to CulturedStar.mdf. I need to change the physical name and logical name.I'm working with Microsoft SQL Server Management Studio Express. How do I do this?Thank you so much for your time and effort ~ Paul |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-31 : 12:01:30
|
| Take a backup of the database, then drop it.Restore the backup with a new name.,Peter LarssonHelsingborg, Sweden |
 |
|
|
Paul_Russ
Starting Member
5 Posts |
Posted - 2006-12-31 : 13:44:31
|
| I know how to make a back up but I don't know how to restore it from the .bak file. Can you help? Thanks ~ Paul |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-12-31 : 13:48:41
|
| http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=RESTORE%20syntax%20/%20exampleKristen |
 |
|
|
Paul_Russ
Starting Member
5 Posts |
Posted - 2006-12-31 : 15:45:32
|
| Oh yeah, that's specific. I'm trying to restore and it isn't working. Is there a specific script that I can use? Thanks ~ Paul |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2006-12-31 : 20:41:07
|
| as said in [url=http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76966]this thread[/url], dont backup restore (unless u already dropped db and its too late). use script shown. do u have permissions to perform actions requested? are u getting error messages? |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-01-01 : 04:36:39
|
| "I'm trying to restore and it isn't working"What error etc. are you getting?"Is there a specific script that I can use?"What's the problem with the one I posted?I now see you've posted a duplicate: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76966Please don't do that as it causes people to answer your question in multiple places and wastes their time.Kristen |
 |
|
|
rajith
Starting Member
2 Posts |
Posted - 2007-01-02 : 03:01:36
|
| HelloHere is the query to change the database namesp_renamedb 'old_name','new_name'in urssp_renamedb 'aspnet','culturedstar'it will change to CulturedStar (physically and logically) |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-01-02 : 04:18:32
|
| "physically and logically"No in SQL 2000 it doesn't. The database name is changed, but not the physical file names, nor the logical names. Which IMO leads to great confusion downstream - either when the MDF/LDF filenames are seen, or attempting to Restore from a Backup using the Logical names as an aide.Kristen |
 |
|
|
|
|
|