Tricky one!! | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Tricky one!!

Hi Whoever can answer this.
I have the backup set of one database. From this backup I want to restore only the mdf file. When I do restore filelist only it shows me the size of the data files as 1 GB and log file as 11 GB. Now free space on disk is only 7 GB and hence I can do the restore. I get error that insufficient free space on disk. Need around 12 GB free space on disk. Please note that the backup set is only 263 MB. I want to restore only the mdf portion from the backup set. How do I do this?
Thanks, StarWarsBigBang
Look up sp_attach_single_file_db in BOL.
I did look into BOL before writing this question. Please note that my question is that I want to restore only the mdf portion of data from the backup file. If you try ‘restore filelistonly from <‘backup file path’>’ then it will show the mdf and ldf with their sizes at the time of backup. I want to restore only the mdf and not attach the file.
You cannot attach a database from a backup set.
Thanks, StarWarsBigBang
Sorry, missed the "from backup set" bit. You’ll have to restore the backup on a server that has sufficient disk space, then sp_deattach the database. Now you can copy the MDF from the temporary server to your actual server, and use sp_attach_single_file_db.