In SSIS, when defining a fixed flat file length flat file connection, is there a way to programmatically define the columns?

I couldn’t play with my four-year-old yesterday. Why not you ask?

Because I had a 150 column fixed length file that I needed to configure in SSIS for import into a SQL server database.

I know how to do this but not being able to define the columns programmatically is driving me bonkers. It’s worse than watching American Idol reruns.

In the “Flat File Connection Manager Editor” I set the format to “Ragged right” check off “Column names in the first data row”.

Then in the columns tab there is the interface where you define the columns.

I have the columns definitions in an excel spread sheet. I know the column names and the exact length.

But why in the name of Zeus do I have to manually click on that stupid little ruler thing 150 times

I should be able to script this out.

I mean sitting there clicking off the columns in absolutely mind-numbing. What should have taken an hour took me three hours because every three columns or so the editor bounced me back to the beginning of the row forcing me to scroll back to where I was (argh!!!!).

I even opened up the SSIS package.dtsx file to see if I could edit it outside of Visual Studio, however the GUID value next to the DTSID property nixed that brilliant idea.

So my dear StackOverFlow community is there a way to define a fixed length flat file connection programmatically and thereby skip the fun of clicking off 150 columns manually?



You'll typically open an existing (template) package through .NET using the Microsoft.SqlServer.Dts.* classes, add the connection manager and the columns and then save the package for further tweaking by hand.

Need Your Help

How to call function in parent controller from directive

angularjs angularjs-directive

I have angular controller and its been split down into a directive.

Eclipse 3.x to E4 uplift. Could not start styling support...A null service reference is not allowed

java eclipse swt rcp e4

We have an RCP application that is running on the Eclipse 3.x platform and we're working on migrating it to pure E4 in the future. But just for now we're trying to pull in all the necessary depende...