Changing SQL Server logical file names

Posted on 2007-03-31
Last Modified: 2010-03-19

Is there any way of changing the logical filename of all files in a SQL Server 2005 database.

I'm using SQL Server 2005 Express and the Management Studio Express.

Question by:PantoffelSlippers
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 250 total points
ID: 18828369

ALTER DATABASE yourdb MODIFY FILE ( name = current_name , NEWNAME = new_name )
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18828370

Author Comment

ID: 18828403

That worked like charm.  I also found afterwards it's also very easy to just do it through Management Studio Express.  Always good to know the code as well.  Thanks

Author Comment

ID: 18828404
Hope I'm not breaking any rules with this:

I've got another question with no replies yet.  Maybe it just doesnt match a lot of searches....

Would someone pls have a look:


Featured Post

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question