USP_SIMPLEDATALIST_PDACCOUNTSTRUCTURE2
Returns a list of all segment tables.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@PDACCOUNTSYSTEMID | uniqueidentifier | IN |
Definition
Copy
CREATE procedure dbo.USP_SIMPLEDATALIST_PDACCOUNTSTRUCTURE2(@PDACCOUNTSYSTEMID uniqueidentifier)
as
select t1.ID as VALUE, t1.FRIENDLYTABLENAME as LABEL
from dbo.PDACCOUNTTABLESAVAILABLEFORSEGMENT t1 left join dbo.PDACCOUNTTABLESAVAILABLEFORSEGMENTPRODUCTFLAG t2 on t1.ID = t2.PDACCOUNTTABLESAVAILABLEFORSEGMENTID
left join dbo.INSTALLEDPRODUCTLIST t3 on t2.PRODUCTFLAGID = t3.ID
where (t2.ID is null
or t3.ID is not null) and t1.ID != 'E27FB5F2-A56F-424A-9E9F-72EA9B8FA816'
--and t1.ID not in (select PDACCOUNTTABLESAVAILABLEFORSEGMENTID from dbo.PDACCOUNTSTRUCTURE
--where PDACCOUNTSYSTEMID = @PDACCOUNTSYSTEMID)
group by t1.ID , t1.FRIENDLYTABLENAME
order by case FRIENDLYTABLENAME when '<Constant Value>' then 'ZZZZ' else FRIENDLYTABLENAME end