Restore sql database

Trying to restore sql server database using below syntex but I'm getting error

RESTORE DATABASE MyDatabase
   FROM DISK='D:\erase\MyDatabase.BAK'
   WITH MOVE 'MyDatabase_Data' TO 'd:\MSSQL\Data\MyDatabase_Data.MDF',
   MOVE 'MyDatabase_Log' TO 'd:\MSSQL\Data\MyDatabase_Log.LDF';
   GO

Error:

MODIFY FILE encountered operating system error 112(There is not enough space on the disk.) while attempting to expand the physical file
Bharat GuruAsked:
Who is Participating?
 
Paul JacksonConnect With a Mentor Software EngineerCommented:
you can't you need to truncate the database before you produce the backup
0
 
Paul JacksonSoftware EngineerCommented:
The error implies that there is not enough space on the d: drive to perform the restore.
0
 
swadhinrayCommented:
The cause of the error message says lack of free disk space.
You need to free up disk space.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
kamindaCommented:
It seems there is no enough space to restore the database to D:\ drive, restore it to another drive by changing the file path or just free up D: drive.
0
 
Bharat GuruAuthor Commented:
I have enough disk space
0
 
Bharat GuruAuthor Commented:
how can i restore only data wihtout log
0
 
devlab2012Commented:
you cannot restore only data without log. But if you think your log file is too large, you can truncate it after restoring your database. The command used to truncate log file is:

Backup Log DBName with truncate_only

and then shrink your database to free up the space:

DBCC SHRINKDATABASE(DBName, TRUNCATEONLY)
0
 
Paul JacksonSoftware EngineerCommented:
Run a full backup of the database and truncate the log, then perform a second backup and try restoring that.
0
 
Bharat GuruAuthor Commented:
How can I truncate from MyDatabase.BAK file,
0
 
Bharat GuruAuthor Commented:
some how restoring to 2008 worked
0
 
VENKAT KOKULLASQL Server DBACommented:
This Issue is with space on the particular disk on which you are going to restore the database
0
 
Paul JacksonSoftware EngineerCommented:
The comment chosen as the solution is not appropriate as it is not a solution.
0
 
Paul JacksonSoftware EngineerCommented:
3) Accept one or more Expert posts as the answer. Comment http:#a35134940 was the first comment to explain the cause of the error.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.