01-10-2023 10:21 AM - last edited on 04-02-2024 11:31 AM by Mercedes_O
I'm getting this error when updating or deleting any IP / Range location. Any ideas how I can correct this?
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. The statement has been terminated.
Solved! Go to Solution.
01-10-2023 11:32 AM
Hello there!
There is a known issue in the current Lansweeper version when deleting IP locations that are in use, and a fix should be included in one of our future releases. We recommend checking our changelog for bug ID: LAN-14512 when a new version is released to ensure that a fix was included. You can enable the update check in the Lansweeper web console under Configuration\Your Lansweeper License to be notified of any new releases.
You can find our changelog here: https://www.lansweeper.com/changelog.aspx
01-18-2023 09:50 PM
Is there a workaround?
01-19-2023 08:23 AM
Hello there!
We have found a workaround for deleting the IP locations. Please make sure to take a backup before attempting to do so, and carefully test the results before moving on. Backup instructions can be found here: https://www.lansweeper.com/knowledgebase/backing-up-your-installation/
To run the script on the database:
Script (replace INSERT IP LOCATION NAME HERE with the name you'd like to delete):
Use lansweeperdb
DECLARE @counter INT;
Declare @locationID INT;
SET @locationID = (select top 1 LocationID from tsysiplocations where IPLocation='INSERT IP LOCATION NAME HERE')
SET @counter =
(
SELECT COUNT(assetid)
FROM tblassets
WHERE locationid = @locationid
);
WHILE(@Counter >= 1)
BEGIN
UPDATE tblassets
SET
tblassets.LocationID = -1
WHERE Assetid IN
(
SELECT TOP 1 assetid
FROM tblassets
WHERE LocationID = @locationid
);
SET @counter = @counter - 1;
END;
01-17-2023 09:58 PM
I'm getting a similar error when trying to import some IP Location ranges. Is this the same bug?
01-18-2023 09:09 AM
Hello there!
The first error on your screenshot is indeed the same bug. But I would contact technical support to check the second error message to ensure that this is part of the known issue.
To contact support: https://www.lansweeper.com/contact-support/
01-10-2023 11:32 AM
Hello there!
There is a known issue in the current Lansweeper version when deleting IP locations that are in use, and a fix should be included in one of our future releases. We recommend checking our changelog for bug ID: LAN-14512 when a new version is released to ensure that a fix was included. You can enable the update check in the Lansweeper web console under Configuration\Your Lansweeper License to be notified of any new releases.
You can find our changelog here: https://www.lansweeper.com/changelog.aspx
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now