Solved

SSIS basics, flat file questions

Posted on 2013-10-22
7
371 Views
Last Modified: 2016-02-11
I understand the basics on SSIS but trying to understand some nuances . . .

my task is simple - read a flat file with one column, right-trim the data, and append " } " to end of record. I've already done this successfully but have a few questions to better understand SSIS.

My flat file has a record size of 103 chars, but with spaces at the end it's 133.

When I point to this file in SSIS for a data connection, it can see the file ok (1 column), but in the Advanced tab it says "OutputColumnWidth = 50" (and InputColumnWidth = 0)
flat-file-connection.png
- why doesn't it "see" that the file size is 103 (or 133) ? I guess 50 is the default no matter what ?

- I don't understand having both "InputColumnWidth" and "OutputColumnWidth" . I just ignored "InputColumnWidth" and got my task completed.
0
Comment
Question by:Alaska Cowboy
  • 4
  • 3
7 Comments
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 250 total points
ID: 39592045
>read a flat file with one column, right-trim the data, and append " } " to end of record.
In between your source and destination, add a Derived column task, replacing existing column, with an expression that goes like this:

TRIM(ColumnName) + "}"

Open in new window

0
 
LVL 65

Accepted Solution

by:
Jim Horn earned 250 total points
ID: 39592139
>why doesn't it "see" that the file size is 103 (or 133)
Don't know, but make sure you have the file format and Header row delimeter correct.

>I guess 50 is the default no matter what ?
Correct.
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 39592143
Jim, ok, thanks, I'm getting beyond the beginner phase . . .
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 39593869
Jim, what about this:

>>- I don't understand having both "InputColumnWidth" and "OutputColumnWidth" . I just ignored "InputColumnWidth" and got my task completed.
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39593878
Don't know about that one.  I've noticed that it's set when you do a fixed with / ragged right, and usually the same values.
0
 
LVL 1

Author Comment

by:Alaska Cowboy
ID: 39593977
Ok, I'll just keep my eyes on it to see how it's handled in different cases.
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39594016
Thanks for the grade.  Good luck with your project.  -Jim
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My client sends data in an Excel file to me to load them into Staging database. The file contains many sheets that they have same structure. In this article, I would like to share the simple way to load data of multiple sheets by using SSIS.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question