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)
 Text 2 DB

Author  Topic 

ragh
Starting Member

34 Posts

Posted - 2004-03-11 : 00:23:21
Hi guys,

I have a problem and i think it can be done very nicely in SQL Server itself instead of using VC++.
The Scenario:
I get some text files(XXXXfd.txt) where XXXX=Areaname and fd = Fixed Deposits - Naming convention used.
Now i put these files into a folder in C:\FilesArrived.
Then when i run the program it will convert each line in this file into a row in tableXXX.
Now i want this to be made in SQL Server, i think a store proc can make this operation.
can u guys help me with a code, pleasee
then text file format will be as follows:
---
All i want is to fectch each line from a textfile from specified folder and put it in a table, if the same details exists then overwrite with newly arrived textfile or else leave it as it is.
---
This is the file i get in filexxx.txt format
" 1010 ";"SHIPOO";"FD ";"GHARE GAJANAN RAGHUNATH ";"120350 ";"12/11/1999";"RIRD ";" 1670600";"1050";" 1935200";"12/11/2002";" 2279900";"21/04/2001";

**just copy and paste it in notepad..**
** The semi-colon represents Seperator**

I hope u guys will help me !
thanks in Adv, and warm regards

Ragh

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-03-11 : 00:26:34
Look in Books Online under "BULK INSERT" and "bcp". You'll find a lot of information on how you can use them for this task.
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2004-03-11 : 01:04:43
Also see: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=33263

OS
Go to Top of Page
   

- Advertisement -