Ntext Formating

  • 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:-

    This is going to be a lot of text......
    To buy a

    house in the UK now requires a very large deposit, more than 5 times the

    amount that was necessary in 1999 Type>Detached£300,000Berkshire

    Yes4<
    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

    Tags

    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

  • This was removed by the editor as SPAM

  • 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