Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 SQL Bulk Insert

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-07-23 : 07:34:07
Mirza Amer Baig writes "I want to Load a text file in a three column Table with three fields, all comma separated like:-

923335100025,Amer,Baig
923335100017,Asif,Qazi
923335100089,Maz
923335120084,Tahir,Ch
923335120085,Waseem


My format file is

7.0
3
1 SQLCHAR 0 20 "," 1 msisdn
2 SQLCHAR 0 20 "," 2 name
3 SQLCHAR 0 20 "\r\n" 3 lname


The problem is that the text file may contain all fields or not.


How to load such file. I have struggled a lot please help


Regards,

Amer"

X002548
Not Just a Number

15586 Posts

Posted - 2003-07-23 : 12:25:12
What does that mean?

Does it mean you don't get a comma?

Like

"a","c"
"a","b","c"

???

What happens if it's only 1 of the values?

Where do you propose which column it goes in to?


How would you know?

How do you know for example in my first ro example that the data should be in column 3 and not 2?

You need to require a clean file to load.

How do you get such a file in the first place

Ask if you can get a fixed width file (what's that?) from your source.



Brett

8-)
Go to Top of Page
   

- Advertisement -