Home All Groups Group Topic Archive Search About

Most efficient way to transfer OdbcDataReader to sql server

Author
23 May 2006 10:27 PM
Craig Lucas
I havent seen anyway to transfer the data over to sql server in a graceful
way. I have to generate sql statements dynamically or loop through each
record and call a stored procedure. Is there a more efficient/bulk way of
moving the data?

PS: Assume I cannot use DTS and the ODBC connection must be established
dynamically, meaning I cant create a DSN.

--
Craig Lucas
President
ByDesign Software, Inc
phone: (954) 605 - 1674

Author
24 May 2006 12:24 AM
Ken Tucker [MVP]
Hi,

        If you are using vs 2005 take a look at the sqlbulkcopy.

http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx

Ken
-----------------
Show quoteHide quote
"Craig Lucas" <craiglu***@bellsouth.net> wrote in message
news:kTMcg.24245$qd2.1841@bignews6.bellsouth.net...
>I havent seen anyway to transfer the data over to sql server in a graceful
>way. I have to generate sql statements dynamically or loop through each
>record and call a stored procedure. Is there a more efficient/bulk way of
>moving the data?
>
> PS: Assume I cannot use DTS and the ODBC connection must be established
> dynamically, meaning I cant create a DSN.
>
> --
> Craig Lucas
> President
> ByDesign Software, Inc
> phone: (954) 605 - 1674
>