SQL Server 2014 - 关键字'tran'附近的语法不正确

时间:2021-12-15 22:50:27

I am trying to install a stored procedures. When I run the query I get Incorrect syntax near the keyword 'tran'

我正在尝试安装存储过程。当我运行查询时,我在关键字'tran'附近获得了错误的语法

The 'tran' keyword is used in dump tran master with no_log

'tran'关键字在dump tran master中使用no_log

It would be helpful if anyone help me overcome this issue.

如果有人帮助我克服这个问题会很有帮助。

2 个解决方案

#1


2  

You're getting a syntax error because TRAN isn't a SQL keyword and isn't valid for the syntax of DUMP. See https://technet.microsoft.com/en-us/library/ms187315(v=sql.90).aspx. To use DUMP properly, it's either DUMP DATABASE or DUMP TRANSACTION

您收到语法错误,因为TRAN不是SQL关键字,并且对DUMP的语法无效。请参阅https://technet.microsoft.com/en-us/library/ms187315(v=sql.90).aspx。要正确使用DUMP,可以使用DUMP DATABASE或DUMP TRANSACTION

Note that per the above link, DUMP is flagged as deprecated and only exists for backwards compatibility. It will go away in the future. You should be using BACKUP (probably BACKUP LOG in this case) instead.

请注意,根据上述链接,DUMP被标记为已弃用,仅用于向后兼容。它将来会消失。你应该使用BACKUP(在这种情况下可能是BACKUP LOG)。

#2


2  

From some SQL Server 2005 documentation on DUMP, I found the following:

从DUMP上的一些SQL Server 2005文档中,我发现了以下内容:

The DUMP statement is included for backward compatibility. This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Instead, use BACKUP.

包含DUMP语句是为了向后兼容。此功能将在Microsoft SQL Server的未来版本中删除。避免在新的开发工作中使用此功能,并计划修改当前使用此功能的应用程序。而是使用BACKUP。

I bet that DUMP has already been removed from SQL Server 2014.

我敢打赌,DUMP已经从SQL Server 2014中删除了。

#1


2  

You're getting a syntax error because TRAN isn't a SQL keyword and isn't valid for the syntax of DUMP. See https://technet.microsoft.com/en-us/library/ms187315(v=sql.90).aspx. To use DUMP properly, it's either DUMP DATABASE or DUMP TRANSACTION

您收到语法错误,因为TRAN不是SQL关键字,并且对DUMP的语法无效。请参阅https://technet.microsoft.com/en-us/library/ms187315(v=sql.90).aspx。要正确使用DUMP,可以使用DUMP DATABASE或DUMP TRANSACTION

Note that per the above link, DUMP is flagged as deprecated and only exists for backwards compatibility. It will go away in the future. You should be using BACKUP (probably BACKUP LOG in this case) instead.

请注意,根据上述链接,DUMP被标记为已弃用,仅用于向后兼容。它将来会消失。你应该使用BACKUP(在这种情况下可能是BACKUP LOG)。

#2


2  

From some SQL Server 2005 documentation on DUMP, I found the following:

从DUMP上的一些SQL Server 2005文档中,我发现了以下内容:

The DUMP statement is included for backward compatibility. This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Instead, use BACKUP.

包含DUMP语句是为了向后兼容。此功能将在Microsoft SQL Server的未来版本中删除。避免在新的开发工作中使用此功能,并计划修改当前使用此功能的应用程序。而是使用BACKUP。

I bet that DUMP has already been removed from SQL Server 2014.

我敢打赌,DUMP已经从SQL Server 2014中删除了。