Solved

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

Posted on 2014-04-08
2
354 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

736 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