SQL

SQL - Check Headoffice (HO) Database for Duplicated RemoteTransID

Overview

Multivenue system, upgrading BEPOZ to version 4.6.1.22 and above

Perform the following check to ensure that the HO does not have any duplicated RemoteTransID's 

Instructions:

---- Do check for duplicated RemoteTransID's for All Venues

SELECT DISTINCT
         VenueID,
         Count(*) as Duplicate_RemoteTransID_Count,
         'Before Bepoz Upgrade VenueDataRecovery Required' as Requirement,
         'Check Open Tables Before Creating a VenueDataRecovery' as Tables
         FROM
     (
        SELECT remoteTransID, VenueID, COUNT(*) as Count FROM Transactions
              where RemoteTransID <> 0
        GROUP BY
               RemoteTransID,
               VenueID 
     HAVING COUNT(*) >= 1
        )
        as Duplicate
GROUP BY
      VenueID
ORDER BY
       VenueID ASC

 

This is an additional check if you want to filter down the the venue list to 1 venue only.

-- Do check for duplicated RemoteTransID's for 1 Venue Only (change @VID = 'VenueID')

DECLARE @VID INT;

SET @VID = 7; -- Change for VenueID

SELECT VenueID, RemoteTransID, COUNT(*) as Count

FROM Transactions

where venueid = @VID and RemoteTransID <> 0

GROUP BY Venueid, RemoteTransID

HAVING COUNT(*) > 1

 

If you see in the Output Result, any VenueID's listed below then do a VenueDataRecovery for that RemoteVenue before Upgrading to Bepoz 4.6.1.22 and above


Related Articles:

  • Bepoz Upgrade to 4.6.1.22 and above Multivenue RemoteTransID duplication check (Overview)

  • How to fix Pending Sales on Smartcontroller after Upgrade to BEPOZ 4.6.1.22 and above

  • Database.exe - Create Venue Data Recovery