Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Using Select statement in SSIS on Excel source

$
0
0

 Hello,

In my select statement for a Excel source I want to specifically set the column names via an alias so that they reflect the column names in my database table and that the assignments are made automatically.

The problem I have is that I can't get to the last row.

Right now I have it this way:

SELECT     
[sheetName$R18:R18].F1 AS Col1, [sheetName$R19:R19].F1 AS Col2, [sheetName$R20:R20].F1 AS Col3,[sheetName$A2:P].*
FROM         
[sheetName$R18:R18], [sheetName$R19:R19], [sheetName$R20:R20], [sheetName$A2:P]

notice the [sheetName$A2:P] which gives me all the values in A to P columns till the last row.

So now I want to assign aliases to A to P. It looks like I can't just write the alias behind "[sheetName$A2:A].* AS someName".

If I remove the numbers on the columns behind ":" it basically will run down 1000's of columns and I have to stop it manually.

There must be some way to do this, I just can't figure out the right syntax.

Hope you can show me how.

thank you.



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>