locked
Attaching a database without its log file RRS feed

  • Question

  • Hello All,

    I am trying to attach a database without its log file using the below command.

    "CREATE DATABASE TestDb ON
    (FILENAME =N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TestDb.mdf')
    FOR ATTACH_REBUILD_LOG
    GO
    "

    I am getting the below mentioned error..

    File activation failure. The physical file name

    "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\AdventureWorksDW2012_log.ldf"

    may be incorrect.The log cannot be rebuilt when the primary file is read-only.

    Msg 1813, Level 16, State 2, Line 1Could not open new database 'TestDb'. CREATE DATABASE is aborted.

    please assist.

    Thanks in advance



    Thanks and Regards, Readers please vote for my posts if the questions i asked are helpful.

    Thursday, June 26, 2014 6:47 PM

Answers

All replies