本文介绍了错误[42000] [Microsoft] [SQL Server Native Client 10.0] [SQL Server] BACKUP日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我正在使用sql server 2008.



hi I'm using sql server 2008.

con.Open()
           cmd = New OdbcCommand("DBCC SHRINKFILE(Legend_Log, 1)", con)
           cmd.ExecuteNonQuery()
           con.Close()
           con.Open()
           cmd = New OdbcCommand("BACKUP LOG Legend TO DISK=N'F:\full'", con)
           cmd.ExecuteNonQuery()
    i'm Getting below error on this line
       con.Close()
           con.Open()
           cmd = New OdbcCommand("DBCC SHRINKFILE(Legend, 1)", con)
           cmd.ExecuteNonQuery()
           con.Close()













ERROR [42000] [Microsoft][SQL Server Native Client 10.0][SQL Server]BACKUP LOG cannot be performed because there is no current database backup. ERROR [42000] [Microsoft][SQL Server Native Client 10.0][SQL Server]BACKUP LOG is terminating abnormally.





帮帮我修复



Help me to fix

推荐答案

Dim result As Integer
con.Open()
cmd = New OdbcCommand("BACKUP DATABASE Legend TO DISK=N'F:\full'", con)
result = cmd.ExecuteNonQuery()
cmd.CommandText = "BACKUP LOG Legend_log TO DISK=N'F:\full'"
result = cmd.ExecuteNonQuery()
cmd.CommandText = "DBCC SHRINKFILE(Legend_log, 1)"
result = cmd.ExecuteNonQuery()
con.Close()





在这里你可以找到一些关于SQL Server备份的基础知识:

[]


这篇关于错误[42000] [Microsoft] [SQL Server Native Client 10.0] [SQL Server] BACKUP日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 12:20
查看更多