Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML String in a single SQL DB field

Status
Not open for further replies.

cpuphantom

IS-IT--Management
Jan 8, 2001
58
US
Hello folks.

Disclaimer: I did not design the database I am about to tell you about. I am merely trying to use that database.

Here's the thing... my office uses an application as our contact management database. I am trying to write a website in ASP that will allow access to this very same data. Most of the database is normal... easy to access. But one table does something kinda dumb. It stores what appears to be an XML string in one field in a table. Basically a list of questions and answers that I need to gain access to. My question is: is there an easy way to read this? Something built in to SQL that I don't know about?

Basically the table has the following fields:
script_id
Description
script_text

and script_text has something like this saved in it:
"<QUESTION1>Question Text</QUESTION1><ANSWER1>Answer text</ANSWER1><QUESTION2>Question Text</QUESTION2><ANSWER2>Answer Text</ANSWER2>"

So my question is: what is the easiest way to read this data? Is there anyway to pull the text for Question1, Question2, Answer1, and Answer2 from the field as if they were fields of their own?

Thank you!
 
Where do you want to ready this? If you need to put it to a web page or something like that it shouldn't be to difficult...you can read it (not dynamically) within sql with various substring statements at index statements...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top