XML data type in SSRS 2008
We have one table with one column. Type of this column is XMLDATATYPE(with xml in it). What will be the best way to create a report to show data from this xml, and to filter by one field from this xml? Thanks, Adrian.
November 19th, 2011 9:38am

Hi Adrian, http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/7be34661-e90f-4f8c-b914-e21647d0af6d/#8171737c-e59a-440b-bb7b-47ae804bf6f5 This may help you. I suggest to convert xml in database level only. If you have large amount of data, SSRS performance is not good at all.
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2011 11:17am

I have a column named info in my table named CTE, the field has data like bellow <Source> <product>DAL</product> <Site>HYD</Site> <market>INDIA</market> </Source> Then I used Select a.b.value('./product[1]','varchar(20)') as product, a.b.value('./Site[1]','varchar(10)') as devSite, a.b.value('./market[1]','varchar(10)') as market from CTE Cross apply info.nodes('Source') as a(b) This results XML data into Relational table format. Cross apply only gives if info column has some xml code in it. if you have null values in your column use OUTER APPLY instead of Cross Apply. Hope it helps you.
November 19th, 2011 12:17pm

Hi Pascari, Thanks for your post and Neo_Deep’s reply. You can use the xml data type methods to query an XML instance stored in a column of xml type, and retrieve the data into the dataset of your report, then show it on your report. More information about how to use XML data type methods, please refer to the MSDN link below: http://msdn.microsoft.com/en-us/library/ms190798.aspx Thanks, Bill Lu Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
November 20th, 2011 2:18am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics