https://login.veeam.com/en/oauth?client_id=nXojRrypJ8&redirect_uri=https%3A%2F%2Fwww.veeam.com%2Fservices%2Fauthentication%2Fredirect_url&response_type=code&scope=profile&state=eyJmaW5hbFJlZGlyZWN0TG9jYXRpb24iOiJodHRwczovL3d3dy52ZWVhbS5jb20va2IxMzc0IiwiaGFzaCI6ImRiYmVkMGVkLTZiNmYtNDllOS1iZDFiLTBhZWE4NjRhOWE2ZCJ9
1-800-691-1991 | 9am - 8pm ET
EN

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

Challenge

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. 

Cause

The VeeamBackup database failed to upgrade correctly.

Solution

Please run the following script against the VeeamBackup database:

SET NOCOUNT ON
 
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')
BEGIN
        PRINT 'Dropping [db50_update] default...'
        DROP DEFAULT db50_update
END
 
IF EXISTS (SELECT * FROM sys.objects WHERE name = 'db50_logging' AND type = 'D')
BEGIN
        PRINT 'Dropping [db50_logging] default...'
        DROP DEFAULT db50_logging
END
 
PRINT 'Success'
GO

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:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796, 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.  
KB ID:
1374
Product:
Veeam Backup & Replication
Version:
6.0.0.153
Published:
2011-12-01
Last Modified:
2020-08-13
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.

OK

error icon

Oops! Something went wrong.

Please go back try again later.