BACKUP LOG cannot be performed because there is no

2020-05-13 04:16发布

I tried to restore a database but this message showed. How do I restore this database?

Restore of database 'farhangi_db' failed.
(Microsoft.SqlServer.Management.RelationalEngineTasks)
------------------------------ ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: BACKUP LOG cannot be performed because
there is no current database backup. (Microsoft.SqlServer.SmoExtended)

标签: sql-server
14条回答
萌系小妹纸
2楼-- · 2020-05-13 04:37

I fixed my error on restoring to non-existing DB from SQL 2008 to SQL 2014 by putting a check mark on Relocating to the new SQL2014 folder location.

查看更多
【Aperson】
3楼-- · 2020-05-13 04:37

Simply you can use this method:

  1. If you have a database with same name: WIN+R -> services.msc -> SQL SERVER(MSSQLSERVER) -> Stop
  2. Go to your MySQL Data folder path and delete previews database files
  3. Start sql service
  4. Right click on database and select Restore database
  5. in Files tab change Data file folder and Log file folder
  6. Click on OK to restore your database

my problem was solved with this method BY...

查看更多
一夜七次
4楼-- · 2020-05-13 04:39

Another cause for this is if you have the same database restored under a different name. Delete the existing one and then restoring solved it for me.

查看更多
Rolldiameter
5楼-- · 2020-05-13 04:39

Click Right Click On Your Database The Press tasks>Back Up and take a back up from your database before restore your database i'm using this way to solve this Problem

查看更多
我想做一个坏孩纸
6楼-- · 2020-05-13 04:42

Originally, I created a database and then restored the backup file to my new empty database:

Right click on Databases > Restore Database > General : Device: [the path of back up file] → OK

This was wrong. I shouldn't have first created the database.

Now, instead, I do this:

Right click on Databases > Restore Database > General : Device: [the path of back up file] → OK

查看更多
▲ chillily
7楼-- · 2020-05-13 04:45

You can use following SQL to restore if you've already created database

RESTORE DATABASE [YourDB]
FROM DISK = 'C:\YourDB.bak'
WITH MOVE 'YourDB' TO 'C:\YourDB.mdf',
MOVE 'YourDB_Log' TO 'C:\YourDB.ldf', REPLACE
查看更多
登录 后发表回答