Hi all
I have Excel files to process, all in consistent format. Each file has 12 sheets. Each sheet has 'Header' info on rows 1 to 13 then a table of data below (around 160 rows, columns A14:M173)
I'm writing a SSIS package to put all data in the 'tables' from each of the 12 sheets of into a staging table. This I can do using an Excel Data Source >> SQL Command...
SELECT * FROM [Table 1a$A14:M500] WHERE [Region Code] LIKE 'Y%'
UNION
SELECT * FROM [Table 1b$A14:M500] WHERE [Region Code] LIKE 'Y%' ....etc.
What I need to do is for each Excel table, to retrieve single values from two of the header cells and include them in each row returned in the SELECT statements show above. The cells are 'Period' (C5) and 'Status' (C10) - happy to read as varchars
...so that each row would read in the resulting output as:
Period, Status, [Region Code], [Col2], [Col3] etc.
I've played around with declaring variables but am struggling to incorporate into my SQL statements as the have a Where clause.
I know it'll be something simple but obviously not as simple as me.
Thanks