Tag: xml

generate schemas for sql 2008 xml bulk load

hey guys i have to import large sized xml data files (some of them 500 mb in size) into sql 2008. i plan to use sqlxml bulk load for the same. however i am only interested in certain elements of the xml data file, not each and every element. my question is: in the schema […]

Bind an ASP.NET TreeView to SqlDataSource using an XML query

Is it possible to use a SQL query that returns XML, in order to bind a TreeView control to SQL data? In other words, I would like to set up a query that presents table data as hieracrhical XML, and bind this XML to the TreeView.

How do I get multiple XML children inside a single parent node instead of repeating the parent node for each child?

I’m trying to produce valid XML for a HL7 CDA document from SQL Server 2008 using FOR XML. I’m having trouble with the syntax to get multiple children inside a node instead of repeating the node for each child. /* Expected output: <!– ******************************************************** Past Medical History section ******************************************************** –> <component> <section> <code code=”10153-2″ codeSystem=”2.16.840.1.113883.6.1″ […]

Can SQL Server 2005 load an XML object and transverse it like in .NET?

i have a stored proc in sql2005 and it makes use of xml functionality in the manor listed below: SELECT rr.item.value(‘@id’,’varchar(50)’) as id, rr.item.value(‘@name’,’varchar(50)’) as name, rr.item.value(‘@value’,’varchar(50)’) as value, rr.item.value(‘@type’,’varchar(50)’) as type INTO #tmp FROM @xmlInput.nodes(‘/RWFCriteria/item’) as rr(item) the param @xmlInput is a XML data type field in the DB that stored various XML chunks […]

Changing multiple values in an XML column in SQL Server 2008

I’ve got a column in a SQL Server table that is type XML. I want to change multiple values in the XML in a stored proc. I’ve already found the XML.Modify(…) command and have it working for a single value. Can I change multiple values in the XML in one update command or do I […]

Dynamic xml to SQL Server table

I have dynamic generated XML files —–Example1—– <items> <param1>aaaa</param1> <param2>bbbb</param2> <param3>cccc</param3> </items> —–Example2—– <items> <test1>dddd</test1> <test7>eeee</test7> <john1>ffff</john1> <john2>ffff</john2> </items> I want to convert this xml files to table like this —–SQL TABLE for Example1—– Name Value param1 aaaa param2 bbbb param3 cccc —–SQL TABLE for Example2—– Name Value test1 dddd test7 eeee john1 ffff john2 […]

How do I query an XML field in SQL Server 2005 so that it behaves like a table?

I have a table that contains a user_id, and an XML field containing basically a series of values. I need to run a report against the data in the XML, but for the life of me I cannot get the XML out of the field in any useful fashion. Here’s the schema for the table: […]

How to convert a SQL Server result set to XML after the fact?

Is there a way to cause the result set of a SQL Server stored procedure (or any result set, after the fact) to be encoded in XML format? I want the result set to be encoded in XML as if the FOR XML RAW clause was used during selection. However the complex stored procedure logic […]

I want to update my xml column in the database using C#

Hi All Is been while since I am trying to figuare out how to update my xml Column in my SQLServer Table. Ok for clear understanding I want to increment each and every id by 1. Ok this is my Tablename called Setting(SettingId int pk, Name nVarchar(100), XmlSetting xml) //my data.xml <setting> <a id=1/> <b […]

C# sql query to add attributes for the elements in xml

I want to display the XML file by taking tag from the XML_TAGS table, and attributes from theMAPPED_TAGS_ATTRIBUTES table – something like <element attributes></element>: String sql = “SELECT Dtd_Tag,Dtd_Attribute_Name FROM Xml_Tags, Mapped_Tags_Attributes WHERE Mapped_Tags_Attributes.Pdf_Tag = Xml_Tags.Pdf_Tag ORDER BY Mapped_Tags_Attributes.Pdf_Tag FOR XML AUTO”;

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.