Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Importing text with first column which is int

Posted on 2006-06-20
14
Medium Priority
?
278 Views
Last Modified: 2008-03-03
Hi:

 I am trying to import a textfile into MS SQL 2000. However, the first column contains numeric values and the DTS doesnt like this. How do I get around this?

THanks
0
Comment
Question by:LuckyLucks
[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
  • 5
  • 4
  • 4
  • +1
14 Comments
 
LVL 20

Expert Comment

by:Sirees
ID: 16943279
Does it give any error?
0
 
LVL 13

Expert Comment

by:Atlanta_Mike
ID: 16943353
Please post your code.
0
 

Author Comment

by:LuckyLucks
ID: 16943414
Well, the first col is numeric and the rest are text surrounded by double quotes.Fields are TABB delimited. SO when it reads it in it screws up on the field delimitation since the first col is numeric and not surrounded by double quotes.

I get this error:

Invalid delimited data : text quantifier must be followed by a column delimitor (except the last column).
Context: Error caalling OpenRowSet on the provider.

0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 16944484
>>However, the first column contains numeric values and the DTS doesnt like this.<<
There should be no problem importing a numeric value without text delimiters, we do it all the time.  Cosnider posting some sample data and the structure of the SQL Server table.
0
 

Author Comment

by:LuckyLucks
ID: 16944706
I am using a DTS Import Wizard to read in data from a text file. The following is the first row of the text file

Customer_ID      Title      Last_Name      First_Name      Language      Address      Address2      City      Province      Postal_Code      Last_Visit      Recall_Date      

1014      "MR"      "MAY"      "DOE"      " "      "111 ST W"      ""      "St. JOHN"      "PEI"      "H2K6TQ"      29-03-2004      29-03-2008      
0
 
LVL 13

Expert Comment

by:Atlanta_Mike
ID: 16945202
what row delimiter are you using in the file?
0
 

Author Comment

by:LuckyLucks
ID: 16946263
CR LF
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 16947505
Now can we have the structure of the SQL Server table?
0
 

Author Comment

by:LuckyLucks
ID: 16950994
Oh sorry. Here it is:
Customer_ID bigint
Title varchar(5)
Last_Name varchar(35)
First_Name vacrchar(35)
Language char(1)
Address   varchar(50)
Address2  "
City         varcchar(20)
Province   vacrchar(2)
Postal_COde vacrchar(10)
Last_Visit     smalldatetime
Recall_Date   smalldatetime
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 1500 total points
ID: 16953332
It worked fine for me.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 16953381
I have tried repeatedly to post the steps I took, unfortunately I am not having any luck.  I repeatedly get "The page cannot be displayed".

Suffice to say, that I did not have any problems.
0
 
LVL 13

Expert Comment

by:Atlanta_Mike
ID: 16969127
Is this supposed to be tab delimited or column aligned?
0
 

Author Comment

by:LuckyLucks
ID: 17061804
tab delimited
0
 
LVL 13

Expert Comment

by:Atlanta_Mike
ID: 17196346
?
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

715 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