1-800-691-1991 | 9am - 8pm ET

"Error Subquery returned more than 1 value" during upgrade to


When upgrading to version 6 of Backup & Replication, you receive the following error:

Error executing SQL Script DBUpdate.sql_filled. Line 7195. Subquery returned more than 1 value. This is not permitted when the subquery follows =,!=,<,<=,>,>= or when the subquery is used as an expression. 


The VeeamBackup database failed to upgrade correctly.


Please run the following script against the VeeamBackup database:

DECLARE @value int
SET @value = (SELECT MAX([current_version]) FROM [dbo].[Version])
PRINT 'Maximum version=' + cast(@value as nvarchar(max))
DELETE FROM [dbo].[Version]
INSERT INTO [dbo].[Version] ([current_version]) VALUES(@value)
IF EXISTS (SELECT * FROM sys.objects WHERE name = 'db50_update' AND type = 'D')
        PRINT 'Dropping [db50_update] default...'
        DROP DEFAULT db50_update
IF EXISTS (SELECT * FROM sys.objects WHERE name = 'db50_logging' AND type = 'D')
        PRINT 'Dropping [db50_logging] default...'
        DROP DEFAULT db50_logging
PRINT 'Success'

More information

In order to run the script from cmd, please perform the following steps:

1. Save the script as *.sql file (e.g. script.sql) to local disk

2. Make sure that there are no jobs running at the moment

3. Run the following command: sqlcmd -S COMPUTER\INSTANCE -d VeeamBackup -i PATHTOSCRIPT\script.sql -o c:\resetresult.txt
where COMPUTER is the name of computer with database, INSTANCE is the name of instance (VEEAM for default installation), PATHTOSCRIPT is the path to the script. If the script needs to be applied to EM database, please edit the command and replace VeeamBackup with VeeamBackupReporting

4. Restart the Veeam services

Or you may want to login to your database with SQL management studio:, right click on your database and choose the “New query” option, insert the text, and click Execute.

If you continue to have trouble with this solution, contact Support. To perform an upgrade of Veeam Backup & Replication to version 6.0, you must be running version 5.0.1 or 5.0.2. If you have an earlier version of Backup & Replication, contact support for the upgrade path and files.  
Veeam Backup & Replication
Last Modified:
Please rate how helpful this article was to you:
5 out of 5 based on 1 ratings
Thank you for helping us improve!
An error occurred during voting. Please try again later.

Couldn't find what you were looking for?

Below you can submit an idea for a new knowledge base article.
Report a typo on this page:

Please select a spelling error or a typo on this page with your mouse and press CTRL + Enter to report this mistake to us. Thank you!

Spelling error in text

Knowledge base content request
By submitting, you agree that your personal data will be managed by Veeam in accordance with the Privacy Policy.

ty icon

Thank you!

We have received your request and our team will reach out to you shortly.


error icon

Oops! Something went wrong.

Please go back try again later.