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
 Old Forums
 CLOSED - General SQL Server
 CSV file

Author  Topic 

nebujacob2000
Starting Member

1 Post

Posted - 2004-03-01 : 01:07:04
Hi
I have got a csv file.I have to insert data from that file to a sql server data base.I'm using ASP as front end.I have to write some stored procs to insert the csv file to the data base.
Pls help me
Thnx
Nebu

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-03-01 : 01:18:18
Look up BCP and BULK INSERT in Books On Line.
This should do the trick for you.


Duane.
Go to Top of Page

safigi
Starting Member

15 Posts

Posted - 2004-03-01 : 04:18:48
Try this:

SELECT *
FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0',
'Data Source=F:\YourFilesDir;Extended
Properties="Text;HDR=No;FMT=Delimited"')
...[YourFile#txt]

quote:
Originally posted by nebujacob2000

Hi
I have got a csv file.I have to insert data from that file to a sql server data base.I'm using ASP as front end.I have to write some stored procs to insert the csv file to the data base.
Pls help me
Thnx
Nebu

Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-03-01 : 05:09:10
See
http://www.nigelrivett.net/ImportTextFiles.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -