Saturday, February 25, 2012

OPENXML vs BCP

Hi,
My application writes data into sql server.

Currently it converts data into XML (an in memory XML string) and write
using OPENXML.

I want to know if i write it to a csv file and use BCP, then will it be
faster then OPENXML. (i feel, writing to a csv will create IO operation that
will slow down the process).

ThanksIf you have many records, I would expect BCP to be much faster. The fastest
way to import large amounts of data into SQL Server is using a bulk insert
technique like BCP.

If your data originates as XML, you might also check out XML Bulk Load. See
http://msdn.microsoft.com/library/d...lkload_7pv0.asp

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Sandy" <a@.a.com> wrote in message news:dhr9v4$15v@.netnews.net.lucent.com...
> Hi,
> My application writes data into sql server.
> Currently it converts data into XML (an in memory XML string) and write
> using OPENXML.
> I want to know if i write it to a csv file and use BCP, then will it be
> faster then OPENXML. (i feel, writing to a csv will create IO operation
> that
> will slow down the process).
> Thanks

No comments:

Post a Comment