Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Posts
    2

    Question Unanswered: Problems in attaching db

    Does anyone know why trying to attach a db (.mdf and .ldf files) to a new db, the "Attach database" item in the menu is disabled, please? do I have to reinstall SQL Server?

  2. #2
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320

    Re: Problems in attaching db

    Originally posted by atorlone
    Does anyone know why trying to attach a db (.mdf and .ldf files) to a new db, the "Attach database" item in the menu is disabled, please? do I have to reinstall SQL Server?
    You could try to attach your db with a t-sql statement.

    Code:
    sp_attach_db @dbname = 'db name',
        @filename1 = 'path_to/file.mdf' ,
        @filename2 = 'path_to/file.ldf'
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

  3. #3
    Join Date
    Jan 2003
    Posts
    2
    I entered the following in the Query Analyzer and got the result shown:

    EXEC sp_attach_db @dbname = N'AARETAIL',
    @filename1 = N'C:\MSSQL7\Data\AARETAIL_Data.MDF',
    @filename2 = N'C:\MSSQL7\Data\AARETAIL_Log.LDF'

    Server: Msg 5172, Level 16, State 15, Line 1
    The header for file 'C:\MSSQL7\Data\AARETAIL_Log.LDF' is not a valid database file header. The PageAudit property is incorrect.

    I can find nothing about PageAudit property.

    What is it and how do I need to modify the command?

    Many thanks!

  4. #4
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    Originally posted by atorlone
    I entered the following in the Query Analyzer and got the result shown:

    EXEC sp_attach_db @dbname = N'AARETAIL',
    @filename1 = N'C:\MSSQL7\Data\AARETAIL_Data.MDF',
    @filename2 = N'C:\MSSQL7\Data\AARETAIL_Log.LDF'

    Server: Msg 5172, Level 16, State 15, Line 1
    The header for file 'C:\MSSQL7\Data\AARETAIL_Log.LDF' is not a valid database file header. The PageAudit property is incorrect.

    I can find nothing about PageAudit property.

    What is it and how do I need to modify the command?

    Many thanks!
    Do you run MsSql 7 or 2000 ?
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

  5. #5
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    Originally posted by atorlone
    I entered the following in the Query Analyzer and got the result shown:

    EXEC sp_attach_db @dbname = N'AARETAIL',
    @filename1 = N'C:\MSSQL7\Data\AARETAIL_Data.MDF',
    @filename2 = N'C:\MSSQL7\Data\AARETAIL_Log.LDF'

    Server: Msg 5172, Level 16, State 15, Line 1
    The header for file 'C:\MSSQL7\Data\AARETAIL_Log.LDF' is not a valid database file header. The PageAudit property is incorrect.

    I can find nothing about PageAudit property.

    What is it and how do I need to modify the command?

    Many thanks!
    try attaching the database without the logfile:
    EXEC sp_attach_db @dbname = N'AARETAIL',
    @filename1 = N'C:\MSSQL7\Data\AARETAIL_Data.MDF'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •