Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL 2012 Express, move database to another location

Status
Not open for further replies.

gustaf111

Programmer
Jan 16, 2011
87
SE
Hello,

I have created a database in SQL 2012 Express. The database was created in the directory:

C:\Program Files\Microsoft SQL server\MSSQL11.SQLEXPRESS\MSSQL\DATA

I would like to move the database to another location, how do I do that ?

Cheers
Gustaf
 
1. Detach DB With SSMS.
2. Copy DB and Log to new location (Windows Explorer).
3. Attach it back with SSMS.

Borislav Borissov
VFP9 SP2, SQL Server
 
Thanks!

I notice that my network drives could not be slected when you attach the database ? Or are there another way to save a backup of the database to a network drive automatic ?
 
You can place SQL Serevr DB ONLY on local drives.

Borislav Borissov
VFP9 SP2, SQL Server
 
Thanks! And I can not make a automatic beckup to a network drive either ?
 
No, with Express edition you can't make any automatic things.
Because SQL Agent wouldn't work with this version.
If you have other edition then you can make SSIS package where you can backup DB and then copy it to other drive.
With Express edition you can make a batch file using SQLCMD to backup DB and then COPY to copy it to network drive.
Then you can use Windows Scheduler to run this batch file.


Borislav Borissov
VFP9 SP2, SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top