T-Sql SPROC - Parse C# Datatable to XML in Database (SQL Server 2005)

Posted by Goober on Stack Overflow See other posts from Stack Overflow or by Goober
Published on 2010-02-05T15:09:29Z Indexed on 2010/05/17 2:40 UTC
Read the original article Hit count: 384

Filed under:
|
|

Scenario

I've got an application written in C# that needs to dump some data every minute to a database. Because its not me that has written the spec, I have been told to store the data as XML in the SQL Server database and NOT TO USE the "bulk upload" feature. Essentially I just wanted to have a single stored procedure that would take XML (that I would produce from my datatable) and insert it into the database.....and do this every minute.

Current Situation

I've heard about the use of "Sp_xml_preparedocument" but I'm struggling to understand most of the examples that I've seen (My XML is far narrower than my C Sharp ability).

Question

I would really appreciate someone either pointing me in the direction of a worthwhile tutorial or helping explain things.

EDIT - Using (SQL Server 2005)

© Stack Overflow or respective owner

Related posts about sql-server-2005

Related posts about Xml