Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2003
    Posts
    2

    Unanswered: Thrown in the deep end (INSERTING HTML)

    Hey all.

    This is my first post here, and I am new to SQL Server. I have just been given the task of developing a website based on SQL Server and I am trying to insert a long string of HTML (could be up to 5000 chars) into a VARCHAR field. Obviously, this means that there will be double quotes, reserved words and all sorts of tricky bits and pieces in the string, so I think I must need some kind of function for preparing such a string. I have read through the SQL Server book by Wrox press, but it doesn't mention a thing that could help. Does anyone know what needs to be done here?

    Any help is greatly appreciated.

    Regards.

    Steve.

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Refer to Planet source code website for any code examples.

    HTH
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    Jun 2003
    Posts
    2
    Cheers for the reply. Panet Source Code seems to be down atm. One question, though. When you say 'code examples', do you mean that I will need to code an MSSQL function to prepare the string for insertion into the table? I'm using query analyser, and I was kind of hoping that there would be some built in function for preparing the string.

    Regards.

    Steve.

  4. #4
    Join Date
    Jul 2002
    Posts
    9
    Do you have rights to altering the table.
    You could change the column from varchar to text and that should work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •