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

Load data to .txt file with a defined column position

$
0
0

Hi guys,

I am creating an SSIS package that loads data from MSSQL table into a text file. One of the requirement is for the size and position of the data in each column in the text file to be the same.

For instance, if the result of the query is shown as below:

ProductID     ProductName    ProductColor     ProductCategory

1                   Tesla                  Black                  Car

2                   Samsung            White                 Mobile Device

3                   Acer                   Grey                  Laptop

 The requirement is that for each of the rows returned from the table, the column position on each row should be:

ProductID: 1-4

ProductName: 5-20

ProductColor: 21-35

ProductCategory: 36-50

So in the case of ProductID, there should be 3 spaces before the ProductName since the length is one. 

I will greatly appreciate any assistance on this.

Thanks


me


Viewing all articles
Browse latest Browse all 24688

Trending Articles