Move a Database
This article shows how to move a FILESTREAM-enabled database. 1. In SQL Server Management Studio, select to open the Query Editor. 2.
This article shows how to move a FILESTREAM-enabled database.
- In SQL Server Management Studio, select
to open the Query Editor.
- Copy the following Transact-SQL script into the Query Editor, and then select.
This script displays the location of the physical database files that the FILESTREAM
database uses.
- Copy the following Transact-SQL script into the Query Editor, and then select.
This code takes the
database offline.
- Create the folder
, and then move the files and folders that are listed in
step 2 into it.
- Copy the following Transact-SQL script into the Query Editor, and then select.
This script sets the
database online.
7
Note
The examples in this topic require the
database that is created in.
Archive
C:\moved_location
Archive
Archive
USE
[
Archive
]
GO
SELECT type_desc,
name
, physical_name from sys.database_files;
USE
[
master
]
EXEC sp_detach_db [
Archive
];
GO