SQL View

 

 

Create View [dbo].[PCP_Input_VW]
as
select
'PCP_Alloc_CCtoCC' as Tablename,
YearMonth,
Branch_Orig,
null as GL_Account,
Branch_New,
null as Alloc_Lvl,
null as Loc_New,
null as Prod_Grp,
Pct_Allocated,
null as FName,
null as LName
from pcp_alloc_cctocc

union

select
'PCP_Alloc_CCtoProd' as Tablename,
YearMonth,
Branch_Orig,
null as GL_Account,
null as Branch_New,
null as Alloc_Lvl,
null as Loc_New,
Prod_Grp,
Pct_Allocated,
null as FName,
null as LName
from pcp_alloc_cctoprod

union

select
'PCP_Alloc_hc_salary' as Tablename,
YearMonth,
null as Branch_Orig,
null as GL_Account,
null as Branch_New,
null as Alloc_Lvl,
null as Loc_New,
null as Prod_Grp,
Salary_Pct,
FName,
LName
from pcp_alloc_hc_salary

union

select
'PCP_Alloc_hctoprod' as Tablename,
YearMonth,
null as Branch_Orig,
null as GL_Account,
null as Branch_New,
null as Alloc_Lvl,
null as Loc_New,
Prod_Grp,
Pct_Allocated,
FName,
LName
from pcp_alloc_hctoprod

union

select
'pcp_alloc_cctoAlloc_Lvl' as Tablename,
YearMonth,
Branch_Orig,
null as GL_Account,
null as Branch_New,
Alloc_Lvl,
null as Loc_New,
null as Prod_Grp,
Pct_Allocated,
null as FName,
null as LName
from pcp_alloc_cctoAlloc_Lvl

union

select
'pcp_alloc_cctoHCRem' as Tablename,
YearMonth,
Branch_Orig,
null as GL_Account,
null as Branch_New,
null as Alloc_Lvl,
null as Loc_New,
null as Prod_Grp,
Pct_Allocated,
null as FName,
null as LName
from pcp_alloc_cctoHCRem

union

select
'pcp_alloc_cctoloc' as Tablename,
YearMonth,
Branch_Orig,
null as GL_Account,
null as Branch_New,
null as Alloc_Lvl,
Loc_New,
null as Prod_Grp,
null as Pct_Allocated,
null as FName,
null as LName
from pcp_alloc_cctoloc

union

select
'pcp_alloc_glcctoprod' as Tablename,
YearMonth,
Branch_Orig,
GL_Account,
null as Branch_New,
null as Alloc_Lvl,
null as Loc_New,
Prod_Grp,
Pct_Allocated,
null as FName,
null as LName
from pcp_alloc_glcctoprod

GO


Back to Macros

Back to Resume

Back to About Me