February 2, 2006 at 12:59 am
Hi,
I am using SQLServer 2000
I currently have a table with just one field in it of type (ntext), the
reason for this is there is a very large amount of data in it of an XML
format. The data looks something like below althought this is only a small
sample there is actually a lot more in this field:-
house in the UK now requires a very large deposit, more than 5 times the
amount that was necessary in 1999
This exeercise is only to be done the once do I was after the quickest way of doing it without having to learn a new language!
What I want is to break out the data into columns so you have something like
Paragraph HouseType Price Location Garage Bedooms
To buy a house... Detached £300,000 Berkshire Yes 4
The end result above was formated as a table when I submitted it to the forum but for some reason the formatting is removed when I previewed it through the site.
I want to ignore the data between the
Generally I think I need to break the data up based on the foward slash and
work left from there, I think it's going to be based on a left/charindex
principal but I also have to do a convert to varchar in the first place as
you are unable to do much with the data in it's current data type.
If anyone can help it would be much appreciated.
Thanks PD
February 6, 2006 at 8:00 am
This was removed by the editor as SPAM
February 6, 2006 at 11:39 am
If I understand your question correctly, you would be better off parsing the xml using an xml parser (strangely enough) rather than using string functions in SQL Server to do it.
Actually, my advice would be to avoid xml altogether...
/*****************
If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek
*****************/
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply