Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Posts
    9

    Unanswered: Issue in Attaching a Database

    Guys,
    I am trying to attach the database using .mdf file from data folder in MSSQL1/MSSQL, but it is giving error like this..

    TITLE: Microsoft SQL Server Management Studio
    ------------------------------

    Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)

    For help, click: Source: ID: (SQL Server ) - Events And Errors Message Center: Message Details

    ------------------------------
    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ------------------------------

    CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\BankSystemACH.mdf'. (Microsoft SQL Server, Error: 5123)

    For help, click: Source: MSSQLServer ID: 5123 (SQL Server 09.00.4035) - Events And Errors Message Center: Message Details

    ------------------------------
    BUTTONS:

    OK
    ------------------------------



    Can u help me out..
    Thanks in advance..

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Are you sure the MDF file was detached from the original instance?

  3. #3
    Join Date
    Apr 2009
    Posts
    9
    yes..
    I am using windows 2008 SQL Server..

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    That path looks suspiciously like a SQL 2005 path. Are you completely certain the database file is cleanly detached from the SQL 2005 instance? You can query sys.master_files to see if it belongs to any other database.

    If it is not attached, it may being held up by a backup package (check for backup jobs) or virus scan software (data directories should be excluded from on-access scans).

Posting Permissions

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