Insert a HTMl tag into a SQL server table column

  • I need help to build the insert statement for insert the following tag into my table:

    Insert INTO dbo.tblMcenter_Bottom_Report_Fields(FieldLink) Value (the above tag);

    Thank you so much

    Faye

  • the forum doesn't like things that look like html tags....wierd results occur, like the clickable button above, which got rendered as an object instead of text:

    i had to find and replace the single quotes as two single quotes to get this example to work;

    also i replaced less Than/greater than with curley brackets, because even in a code box, it still redered as an html object

    declare @button varchar(max)

    Set @button='{INPUT type=''button'' id=''ReviewButton'' name=''ReviewButton'' value= ''Review'' TrackingID=''@PaymentID@'' onclick='' var ret; ret=window.showModalDialog("../../../iMARC/M_Center/SRIP/ReviewTLFrames.asp?TLTYPE=B03&ACTION_TAB=SRIP&PAYMENT_ID=@PaymentID@",null,"DialogHeight:1000px;DialogWidth:700px;center:yes;edge:sunken;help:no;resizable:yes;scroll:no;status:no");''}'

    Insert INTO dbo.tblMcenter_Bottom_Report_Fields(FieldLink) Value (@button);

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks. I will try it.

  • Lowell (8/12/2009)


    the forum doesn't like things that look like html tags....wierd results occur, like the clickable button above, which got rendered as an object instead of text:

    i had to find and replace the single quotes as two single quotes to get this example to work;

    also i replaced less Than/greater than with curley brackets, because even in a code box, it still redered as an html object

    You need to use HTML escape sequences like

    &lt; = <

    &gt; = >

    &amp; = &

    ' = &#39

    It's not really that difficult, just tedious.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Actually it worked. I already inserted the record. Thank you so much for your help.

Viewing 5 posts - 1 through 4 (of 4 total)

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