USE master;
GO
ALTER database <Database name>
MODIFY FILE (NAME = <database>_Data,
FILENAME = ' J:\sqldb03\MSSQL12.MSSQLSERVER\data\<database>.mdf');
go
ALTER DATABASE <Database name>
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
go
ALTER DATABASE <Database name>
SET OFFLINE
GO
Move files from
U:\SQL01\MSSQL11.SQLE\MSSQL\Data to U:\SQL07\MSSQL11.SQLE\MSSQL\Data
ALTER DATABASE <Database name> SET ONLINE
go
ALTER DATABASE <Database name> SET MULTI_USER
Go
GO
ALTER database <Database name>
MODIFY FILE (NAME = <database>_Data,
FILENAME = ' J:\sqldb03\MSSQL12.MSSQLSERVER\data\<database>.mdf');
go
ALTER DATABASE <Database name>
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
go
ALTER DATABASE <Database name>
SET OFFLINE
GO
Move files from
U:\SQL01\MSSQL11.SQLE\MSSQL\Data to U:\SQL07\MSSQL11.SQLE\MSSQL\Data
ALTER DATABASE <Database name> SET ONLINE
go
ALTER DATABASE <Database name> SET MULTI_USER
Go
No comments:
Post a Comment