• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

Importing text with first column which is int

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
LuckyLucks
Asked:
LuckyLucks
  • 5
  • 4
  • 4
  • +1
1 Solution
 
SireesCommented:
Does it give any error?
0
 
Atlanta_MikeCommented:
Please post your code.
0
 
LuckyLucksAuthor Commented:
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Anthony PerkinsCommented:
>>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
 
LuckyLucksAuthor Commented:
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
 
Atlanta_MikeCommented:
what row delimiter are you using in the file?
0
 
LuckyLucksAuthor Commented:
CR LF
0
 
Anthony PerkinsCommented:
Now can we have the structure of the SQL Server table?
0
 
LuckyLucksAuthor Commented:
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
 
Anthony PerkinsCommented:
It worked fine for me.
0
 
Anthony PerkinsCommented:
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
 
Atlanta_MikeCommented:
Is this supposed to be tab delimited or column aligned?
0
 
LuckyLucksAuthor Commented:
tab delimited
0
 
Atlanta_MikeCommented:
?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 5
  • 4
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now