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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Need to change database location, How?

Author  Topic 

anandchinnappan
Starting Member

7 Posts

Posted - 2010-03-16 : 13:39:04
Hai experts,

On my server (IBM X series server, Windows 2003 ) SQL Server 2005 is installed in C drive under program files folder. I need to move the data files of my database to E drive. How to do that? Would moving data files to a new location cause data loss? Please help.

Thanks in advance.

Regards
Anand

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-16 : 14:45:21
http://support.microsoft.com/default.aspx?scid=kb;en-us;224071&Product=sql2k

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2010-03-17 : 03:48:59
Use Detach database, move physically your mdb and ldf files to new location and reattach your database files from new location (NO DATA LOSS)... ENJOY
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-17 : 16:16:38
It's all explained in the link I posted. It shows how to do it even for the system databases.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -