Restore or attach from just MDF file

  • I have a filegroup backup only of the MDF file no LDF file. Restore will put the MDF file back in the directory folder, but the database is gray and endlessely in a 'loading mode'. (Though NORECOVERY was used in trans-SQL RESTORE command

    How can a functional database be created with only the MDF file, or only a backup of the MDF as a filegroup. The solution likely involve creation of a LDF file that can be associated/attached to the MDF within a new database.

    I have tried the following sp_attach... Execs:

    EXEC sp_attach_single_file_db @dbname = N'Other_SID',

    @physname = 'D:\SQLfiles\Other_SID_Data1.MDF'

    Server: Msg 1813, Level 16, State 2, Line 1

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

    Device activation error. The physical file name

    'C:\Program Files\Microsoft SQL Server\MSSQL$HAD_304_5\data\Other_SID_Log.LDF' may be incorrect.

    EXEC sp_attach_db @dbname = N'Other_SID',

    @filename1 = N'D:\SQLfiles\Other_SID_Data1.MDF'

    Server: Msg 1813, Level 16, State 2, Line 1

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

    Device activation error. The physical file name

    'C:\Program Files\Microsoft SQL Server\MSSQL$HAD_304_5\data\Other_SID_Log.LDF' may be incorrect.

  • You have to prepare the restoration from full database backup.

    Edited by - Allen_Cui on 05/28/2003 2:33:02 PM

  • You have to prepare the restoration from full database backup.

    Wish I could, that is the problem. I only have the MDF backup, and we need to get at the tables.

    The database has been deleted, and the backup transaction logs have been deleted. Only the filegroup backup for the primary MDF file is left.

    We have been working with large patient files, many states over many years. Local space on the SQL server became a problem, then space on the network became a problem, and there were just too many chefs trying to clear space.

    Is there any way, like OBDC, VB code or anything, just to get at the table data in the MDF file?

    tigersbh on 5/08/03 seemed to have a similar problem, but not sure how it was resolved.

    I do appreciate any input.

    Edited by - Ronfx on 05/28/2003 5:14:20 PM

    Edited by - Ronfx on 05/28/2003 5:17:06 PM

  • Go call Microsoft support.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply