Sử dụng CREATE DATABASE ... FOR ATTACH;
. Xem Ví dụ H:
USE master;
GO
--Detach the AdventureWorks2008R2 database
sp_detach_db AdventureWorks2008R2;
GO
-- Physically move the full text catalog to the new location.
--Attach the AdventureWorks2008R2 database and specify the new location of the full-text catalog.
CREATE DATABASE AdventureWorks2008R2 ON
(FILENAME = 'c:\...\Data\AdventureWorks2008R2_Data.mdf'),
(FILENAME = 'c:\...\Data\AdventureWorks2008R2_log.ldf'),
(FILENAME = 'c:\myFTCatalogs\AdvWksFtCat')
FOR ATTACH;
GO