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

KB ID:
1374
Product:
Veeam Backup & Replication
Version:
6.0.0.153
Published:
Last Modified:
2012-03-08

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.  

Please be aware that we’re making changes which will restrict access to product updates for users without an active contract.

OK

Rate the quality of this KB article: 
5 out of 5 based on 1 ratings

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:

Submit