Find Duplicate TabOrders

This script finds parent tabs (pages) that have one or more child tabs with the same TabOrder value. Ideally this script should return no results.

To fix problems identified by this script use the Up or Down arrows in Admin | Pages to move one of the children of each of the parents - this causes the TabOrder for all the children of a given parent to be updated. You will need to update table references in the script if your DNN database uses non-default {databaseOwner} and {objectQualifier} values.

Originally written 17th July 2010. Scripts provided as-is without warranty, use at your own risk.

Find Duplicate TabOrders Script

-- Script for version 5.02.00 onwards.

select distinct
   dbo.Tabs child
      inner join dbo.Tabs parent on parent.TabId = child.ParentId
         inner join dbo.Portals p on p.PortalId = parent.PortalId
            inner join dbo.PortalLocalization pl on pl.PortalId = p.PortalId
                                                and pl.CultureCode = p.DefaultLanguage
   child.ParentId in (select ParentId from dbo.Tabs group by ParentId, TabOrder having count(*) <> 1) 
order by
| Copyright 2007-2020 RMJCS