cancel
Showing results for 
Search instead for 
Did you mean: 

Table Creation in SQL server with specific data type using data from excel file

Marley_Bacelar
New Contributor II

Hi all,

Thanks in advance for read and any help here.

I have a pipeline where I had a excel file, with columns name and table name, so first I read this excel file and them make a parse, this is a sample of the excel file:

image

So I want (if not exist) create a table AAA with the columns 0XX5, 0XX6, 0XX7, 0XX8, 0XX9 each one with the respective Datatype, how can I o that?

2 REPLIES 2

darshthakkar
Valued Contributor

Hi @Marley_Bacelar,

If you want all the columns included in each table, then you can use a copy snap (File Reader → Excel Parser → Mapper → Copy). Intentionally kept a mapper before copy so that you can add/remove any additional columns for your table.

You can refer to this page for changing data types, screenshot below for your reference:

image

Please ensure that you have multiple outputs enabled in your copy snap (can be achieved by clicking the snap itself and then going into the views). Screenshot below for reference:

image

After the copy snap, you can have another mapper snap for each output if you need to do any transformation and then have your target system snaps attached to each copy/mapper snap (if you used mapper snap after copy snap). Screenshot below for your convenience.

image

Thanks!

Hi Darsh,

Thank you very much! Will try this solution!