problem with streamreader or sql server?
Hi all
I have a text file with more than 4000 lines in it.
Each line is of around 400 characters.
In order to mearge this file in one of the table from sql server 2005,
I am reading this file line by line using stramreader class.
I then split the line in 20 field using based on delimeter.
I declared 20 parameters and pass these parameters to a sql stor proc
for inserting the record.
It works fine with small files (less records).
But for big files, it inserts aprrox 2600 (it varies each time) lines to table
and then throgh the error.
Is this due to
1> any buffer size limitation for stream reader
2> code is calling stor proc for each line and so sql server processign so many stor procs?
Please help
Thanks
Radhesham
Re: problem with streamreader or sql server?
Look into using the BulkCopy class in SQLClient.... I've been using it to pulling in data from DBF databases. It's fast and easy to use.
-tg
Re: problem with streamreader or sql server?
Re: problem with streamreader or sql server?
The Error message is
Request Timed Out
Please help.
thanks in advance
Radhesham
Re: problem with streamreader or sql server?
Yeah you probably do want BulkCopy then.