Solved

Create a table based on the data structure and data types in a txt file

Posted on 2014-04-08
2
338 Views
Last Modified: 2016-02-10
Is there a way to create a table based on the data structure and data types in a txt file.

Let's say in the .txt file the data structure is as follows...

Column 0 is a field length of 50 characters
Column 0 is a field length of 50 characters
Column 0 is a field length of 1000 characters
Column 0 is a field length of 50 characters
Column 0 is a field length of 1000 characters


I'd like to create the table as...

CREATE TABLE [BulkTable] (
    [Column 0] varchar(50),
    [Column 1] varchar(50),
    [Column 2] varchar(1000),
    [Column 3] varchar(50),
    [Column 4] varchar(1000)
)

But without having to maunually change the column 2 and column 4 fields to varchar(1000). Is there a way create the BulkTable using the data structure from the .txt file?

I am using SSIS data flow package creation.
0
Comment
Question by:tesla764
2 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 39986560
None that I'm aware of.

SSIS requires a 'contract' between a source and destination, with columns defined, and has a tendency to throw a lot of mapping errors when there is any doubt of those definitions.

So even if it was possible, SSIS is not optimized to handle 'dynamic' data sources.
0
 

Author Closing Comment

by:tesla764
ID: 39992774
Thanks.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now