Solved

Read XML Document using TSQL in Query Analyzer

Posted on 2010-11-22
3
768 Views
Last Modified: 2012-05-10
Hi,

I have a table (Logs) with a column called Message of type XML.
Data is getting stored in this table using a web service (.Net) and they said, it is of type XML document (System.Xml.XmlDocument)

Is there any way to read the value (may be as a string)  through Query Analyzer?
0
Comment
Question by:batchakamal
3 Comments
 
LVL 19

Expert Comment

by:Bardobrave
ID: 34187726
If the xml document is stored as a string you can read it from the table with a simple select. Then you can load it to a xml editor and see it in a normalized way.

If System.Xml.XmlDocument is some type of byte-coded information wich encloses in one of their fields the xml itself, probably you'll only obtain a strange stream of byte data that you won't be able to understand from Query Analyzer.

However you could try to import that data into a project that's able to understood that data type and read it's xml through code.
0
 
LVL 6

Accepted Solution

by:
subhashpunia earned 500 total points
ID: 34195527
You can see the textual data stored in xml datatype column in query analyzer by quering the table using SELECT statement.
IN SQL Server 2005, if you want to see some specific values from then you can xml methods like query(), value(), exist() and nodes().
0
 
LVL 4

Author Closing Comment

by:batchakamal
ID: 34745087
dfdsfsd
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle DB monitor SW 21 47
Help with SQL Server Polygon 2 31
insert wont work in SQL 14 17
Better way to make a query with date filter. 5 21
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now