HTML Output or something similar

  • I am new to SQL and am trying to get paragraphs into and out of a SQL database. I am not sure if I need to go with XML at this point to get rich text formatting, such as HTML. Any assistance would be greatly appreciated.

    Thank you for your time,

    Scott St. Gelais

  • Hello saint

    I would suggest to use XML. After selection of data you can simply transform it with XSLT to HTML.

    Here a little example

    IF (OBJECT_ID('tempdb..#test') IS NOT NULL)

    DROP TABLE #test

    CREATE TABLE #test (id INT, first_name NVARCHAR(100), last_name NVARCHAR(100))

    INSERT INTO #test VALUES (1, 'Mikey', 'Mouse')

    INSERT INTO #test VALUES (1, 'Hoomer', 'Simpson')

    SELECT *

    FROM #test t

    FOR XML AUTO

    DROP TABLE #test

    Greets

    Flo

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply