sql - pivot not working in SSIS -


my sql query works fine when execute in sql management studio throw error below when execute in ssis package. advise?

**when click on build query of syntax - shows

the pivot sql construct or statement not supported.
case 1:

select listid,                 [1]            (select listid,                         val,                         [order]                    gmt_listsvals) p                 pivot (max (val)                       [order] in ([1])) pvt 

case 2:

select comb_id, [orgunit], [time], [gender], [jobcategory], [ethnicity], [gradegroup], [regiongeo], [emplclass], operatorid,  seq_id,  sequance_name, listid    (select c.comb_id, dim_name, v.operatorid,v.seq_id, v.listid, dim_value, s.sequance_name            gmt_combinationsflat c              join gmt_valuesflat v on c.comb_id = v.comb_id              join gmt_rangeseq s on v.seq_id = s.seq_id              join gmt_dimensions d on c.dim_id = d.dim_id           c.kpi_id = 9 , c.last = 1) p  pivot (max(dim_value) dim_name in ( [orgunit ], [time ], [gender ], [jobcategory ], [ethnicity ], [gradegroup ],  [regiongeo ], [emplclass ] ) ) pvtt 

error

exception hresult: 0xc0202009 error @ ..: ssis error code dts_e_oledberror. ole db error has occurred. error code: 0x80040e21. ole db record available. source: "microsoft sql server native client 11.0" hresult: 0x80040e21 description: "multiple-step ole db operation generated errors. check each ole db status value, if available. no work done.".

that statement equivalent to:

select listid, max(case when [order] = 1 val end) [1] gmt_listsvals group listid 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -