Home Forums Data Warehousing Analysis Services Error attaching MdxStepByStep.mdf for SQL Server 2008 MDX Step by Step. RE: Error attaching MdxStepByStep.mdf for SQL Server 2008 MDX Step by Step.

  • Thanks.

    I executed the following

    but it is trying to attach the log file.

    How do I force it to ignore the log file?

    CREATE DATABASE MdxStepByStep

    ON (FILENAME = 'D:\MSSQL\MdxStepByStep.mdf')

    FOR ATTACH;

    sg 5173, Level 16, State 1, Line 1

    One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup.

    Log file 'C:\Microsoft Press\MDX SBS\Setup\SQL Server\MdxStepByStep_log.LDF' does not match the primary file. It may be from a different database or the log may have been rebuilt previously.

    Msg 1813, Level 16, State 2, Line 1

    Could not open new database 'MdxStepByStep'. CREATE DATABASE is aborted.

    When I tried attaching in SSMS and removing the log file I got an error. The Log file does not match the primary file.

    Thanks again.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/