declare @tabid int
declare @tabname nvarchar(100)
set @tabid = 7
--select * from tabs where tabid = @tabid
select @tabname = tabname from tabs where tabid = @tabid
--select * from tabs where IsVisible = 1 and ParentID is null
select top 10 DIFFERENCE(@tabname,tabname),@tabname,tabname from tabs where IsVisible = 1 and ParentID is null order by DIFFERENCE(@tabname,tabname) desc
This code is used to list similar tabnames (pages) when tabid is provided.