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.
| Author |
Topic |
|
shajimanjeri
Posting Yak Master
179 Posts |
Posted - 2008-06-24 : 10:02:10
|
| I am storing one text file on the server.This text file contains some mobile numbers.The file look like009198XXXXXXXX009198XXXXXXXX009198XXXXXXXX009198XXXXXXXXetcHere I need to read this text file row by row mobile number and then insert these mobile numbers into a table by using sql procedure or sql trigger or any other method or coding. Is it is possible or not?If so then anybody can help me!regardsShaji |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-06-24 : 10:12:19
|
| Read about bulk insert in sql server help fileMadhivananFailing to plan is Planning to fail |
 |
|
|
shajimanjeri
Posting Yak Master
179 Posts |
Posted - 2008-06-25 : 02:53:34
|
| Here I created one txt file on C drive. which contains some names likeshajialexMy database table CSVTest structure is Id (numeric auto increment) FirstName (varchar)now I used this bulk queryBULK INSERT CSVTestFROM 'c:\a.txt'WITH(ROWTERMINATOR = '\n')When I run this query it shows "Server: Msg 4832, Level 16, State 1, Line 1Bulk Insert: Unexpected end-of-file (EOF) encountered in data file.Server: Msg 7399, Level 16, State 1, Line 1OLE DB provider 'STREAM' reported an error. The provider did not give any information about the error.The statement has been terminated" errorcan any body correct it please? |
 |
|
|
shajimanjeri
Posting Yak Master
179 Posts |
Posted - 2008-06-25 : 03:39:40
|
| Its ok thanks everybody.Its working after I make some changes... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-25 : 03:41:01
|
quote: Originally posted by shajimanjeri Its ok thanks everybody.Its working after I make some changes...
What was the change made? You can post it if you think somebody might benefit from it in future. |
 |
|
|
|
|
|