Search code examples
sqlsql-serversql-server-2014-express

SQL Server 2014 - Incorrect syntax near the keyword 'tran'


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

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

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


Solution

  • 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

    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.