Make sure copy the .mdf data file into a folder where you will attach database. in my example I have copied under C:\data folder and run the following script.
CREATE DATABASE [AdventureWorksDW2012] ON
( FILENAME = N'C:\Data\AdventureWorksDW2012_Data.mdf' )
FOR ATTACH_REBUILD_LOG
GO
CREATE DATABASE [AdventureWorksDW2012] ON
( FILENAME = N'C:\Data\AdventureWorksDW2012_Data.mdf' )
FOR ATTACH_REBUILD_LOG
GO
No comments:
Post a Comment