Solved

changing the location of mdf and ldf files in MSSQL2005

Posted on 2009-07-09
2
290 Views
Last Modified: 2012-05-07
I have installed the database files (.mdf files) in D:/ drive. My D:/ drive has gone full and I need to change the location of the .mdf location. Currently I am not able to do it SQL2005. Please share the procedures.
I have installed the database files (.mdf files) in D:/ drive. My D:/ drive has gone full and I need to change the location of the .mdf location. Currently I am not able to do it SQL2005. Please share the procedures

Open in new window

0
Comment
Question by:Karthi_devaraj
2 Comments
 
LVL 6

Accepted Solution

by:
rpassero earned 500 total points
ID: 24815168
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24815173
here is an example

ALTER DATABASE AdventureWorks
MODIFY FILE (NAME = AdventureWorks_Data, FILENAME = 'D:\SQLData\AdventureWorks_Data.mdf');
ALTER DATABASE AdventureWorks
MODIFY FILE (NAME = AdventureWorks_Log, FILENAME = 'D:\SQLData\AdventureWorks_Log.ldf');
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now