|
-
Jun 18th, 2007, 10:29 PM
#1
Thread Starter
Addicted Member
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
-
Jun 18th, 2007, 11:36 PM
#2
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
-
Jun 21st, 2007, 10:10 AM
#3
Re: problem with streamreader or sql server?
-
Jun 23rd, 2007, 02:29 AM
#4
Thread Starter
Addicted Member
Re: problem with streamreader or sql server?
The Error message is
Request Timed Out
Please help.
thanks in advance
Radhesham
-
Jun 25th, 2007, 11:01 AM
#5
Re: problem with streamreader or sql server?
Yeah you probably do want BulkCopy then.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|