Re: Inserting into SQL via XML using OLEDB Consumer Templates ?
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Mon, 13 Jun 2005 22:44:45 +0000 (UTC)
Heiko (heiko_dev@xxxxxxxxxx) writes:
> Has anyone got a sample or some links on how to insert data into SQL
> Server via XML ?
The topic on OPENXML in Books Online should take you a long way.
Else have a look at http://www.sqlxml.org/.
> Only saw samples to retrieve XML up to now.
>
> - Ideally I would like to create the XML insert statements in memory,
> not reference an external xml command file.
>
> - If we need to insert between 10 to 10000 rows of data into SQL Server
> table, what options are available to do this from Visual C++ ?
> (Currently we use OLE DB Consumer Templates implementation that calls
> a stored proc for each row insert. )
>
> Is it correct to assume that inserting 3000 rows via XML would be faster
> (one call) than doing 3000 stored proc calls ?
Yes, that's a definite winner. We have several places in our app,
where insert data from a grid page or similar. We used to that one
by one, now a lot of that uses OPENXML for improved performance.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
.
- Follow-Ups:
- References:
- Prev by Date: Re: HOWEVER...
- Next by Date: Re: Syntax error (missing operator) when deleting a row with commandbu
- Previous by thread: Inserting into SQL via XML using OLEDB Consumer Templates ?
- Next by thread: Re: Inserting into SQL via XML using OLEDB Consumer Templates ?
- Index(es):
Relevant Pages
|
|