Solved

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

Posted on 2014-04-08
2
347 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
View SQL 2005 Job package 16 42
migrate a SQL 2008 to 2016, 2 28
Get the latest status 8 30
T-SQL: New to using transactions 9 23
My client sends a request to me that they want me to load data, which will be returned by Web Service APIs, and do some transformation before importing to database. In this article, I will provide an approach to load data with Web Service Task and X…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

776 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