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)
 import csv

Author  Topic 

ccrespo
Yak Posting Veteran

59 Posts

Posted - 2007-08-24 : 11:29:06
is there anyway to import this into a table then delete the flat file?

"1170","Myers","Joseph","22637","9146826419","Gottfried MD","2007-08-23 12:07:53","SUCC MACHINE","2"
"1177","Ferriner","Gregory","27303","9146826419","Pelebecky Jr MD","2007-08-23 12:06:29","SUCC MACHINE","2"
"1476","Vigilio","Althea","213769","9146826571","Sanchez MD","2007-08-23 12:02:14","SUCC PERSON","1"
"1478","Contreras","Carolina","213830","9146826571","George MD","2007-08-23 12:06:51","SUCC PERSON","2"
"1479","Chan","Maria","213890","9146826571","George MD","2007-08-23 12:01:27","SUCC PERSON","1"
"1498","Corcoran","Terence","216765","9141234567","Ceccarelli MD","2007-08-23 12:06:47","SUCC PERSON","2"
"1499","Richard","Virginia","216937","9141234567","Rayner","2007-08-23 12:01:49","SUCC MACHINE","1"
"1501","Hester","Donna","217184","9141234567","Rie MD","2007-08-23 12:06:49","SUCC PERSON","2"
"1139","James","Donna","13569","9141234567","Ceccarelli MD","2007-08-23 12:06:49","SUCC PERSON","2"
"1154","Merritt","Josephine","1680","9141234567","Levat MD","2007-08-23 12:07:59","SUCC PERSON","2"
"1157","Bonell","Jane","8404","9141234567","Rothbart MD","2007-08-23 12:01:00","SUCC MACHINE","1"
"1159","Rockey","John","8544","9141234567","Pelebecky Jr MD","2007-08-23 12:01:48","SUCC MACHINE","1"
"1216","Grubel","Helen","45856","9141234567","Calleo Cross","2007-08-23 12:05:49","LINE BUSY","2"
"1228","Plonchak","Patricia","44702","9141234567","Thompson MD","2007-08-23 12:08:10","SUCC PERSON","2"
"1312","Varbero","George","89029","9141234567","Pelebecky Jr MD","2007-08-23 12:01:47","SUCC MACHINE","1"
"1321","Lind","Thomas","97489","9141234567","Calleo Cross","2007-08-23 12:07:11","SUCC PERSON","2"
"1327","Levi Barnett","Ruth","101710","9141234567","Stein MD","2007-08-23 12:07:10","SUCC PERSON","2"
"1328","Lavieono","Maria","101865","9141234567","Rothbart MD","2007-08-23 12:07:12","SUCC PERSON","2"
"1355","Kingsidaphone","Damdee","127532","9141234567","Rothbart MD","2007-08-23 12:06:48","SUCC PERSON","2"
"1376","Zultowsky","Barrie","151239","9141234567","Stein MD","2007-08-23 12:01:47","SUCC MACHINE","1"
"1384","Acosta","Elpidio","157108","9144946481","Rothbart MD","2007-08-23 12:01:25","SUCC PERSON","1"
"1223","Mcshane","Arthur","44335","9144946481","Newman MD","2007-08-23 12:07:08","SUCC PERSON","2"

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-08-24 : 11:32:52
Have you tried using BCP/DTS?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

ccrespo
Yak Posting Veteran

59 Posts

Posted - 2007-08-28 : 08:32:56
i tried using bcp but I keep getting an error
exec master.dbo.xp_cmdshell 'bcp.exe WMGRecallSystem..TeleminderIn in \\wmg-lab-server\recalldata\teleminderin\uploadtest.txt -c -q -C1252 -U sa -P sa -t@'


The Teleminder table is:
CREATE TABLE [TeleminderIn] (
[OutreachId] [int] NULL ,
[Last] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[First] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PatientId] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Phone1] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Doctor] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CallDate] [datetime] NULL ,
[CallResult] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[AttemptCount] [int] NULL
) ON [PRIMARY]
GO


The error I get is:
Error = [Microsoft][ODBC SQL Server Driver]Unexpected EOF encountered in BCP data-file

Can I use a format file?

Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-08-28 : 22:10:52
Yes, but why don't use bulk insert?
Go to Top of Page
   

- Advertisement -