views:

44

answers:

2

i want to write a stored procedure in java for SQL to parse and store the xml automatically in the corresponding tables is it a good idea or any one guide me how to do it.

thanx in advance

A: 

The xml?

Can you provide an example?

If you are trying to build xml, I think how I would do it is with a template engine such as one of these: (java template engines)

And load all the data you need from sql into that template file.

Or

If you are trying to parse XML I strongly recommend not doing so in sql. Use a xml parsing library to unpack that baby and then maybe a stored proc to put in a database.

To go backwards look at my solution above.

Xml is not an easy thing to parse or create. Jeff Atwood Agrees.

asperous.us
thanx i have already created an XML from user input and send it to an other application where i have to store in DB i thought it will be good to write a stored proc instead of parsing it in my application but it seems really costly i just have to store my xml in to database successfully.
moon
+1  A: 

XML is a great way to store scratch data. MSSQL has awesome support for shredding/querying xml documents.

http://msdn.microsoft.com/en-us/library/ms345117(SQL.90).aspx

Al W