Wednesday, 13 June 2012

Attaching a database (without a log file - .LDF)

Had to to this with the AdventureWorks 2012 download.
ATTACH_REBUILD_LOG is the option here...

CREATE DATABASE [AdventureWorksDW2012] ON 
( FILENAME = N'E:\SQL2012\AdventureWorksDW2012_Data.mdf' )
 FOR ATTACH_REBUILD_LOG
GO