Solved

Changing SQL Server logical file names

Posted on 2007-03-31
4
192 Views
Last Modified: 2010-03-19
Experts,

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.

Thanks
0
Comment
Question by:PantoffelSlippers
[X]
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
4 Comments
 
LVL 143

Accepted Solution

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

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

Expert Comment

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

Author Comment

by:PantoffelSlippers
ID: 18828403
Thanks

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
0
 

Author Comment

by:PantoffelSlippers
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:
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_22457986.html

Thanks
0

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