Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    3

    Unanswered: Html Tags In A Database Column

    As I said before I am a newbie to the world of SQL Server and Transact SQL so here is my question. I want to store pics and a link to a specs page in a database but from my research on storing pics in a db I am finding that this is not a good idea. So I figured that I would try to store the url of the pic itself and dynamicaly insert that into my web apps. The problem is that inorder for this to work I think I need to include the HTLM tags
    in the info stored in the db table. What data type would I use for this or am I way off the planet with this method. Please let me know

  2. #2
    Join Date
    Jun 2003
    Posts
    3

    Re: Html Tags In A Database Column

    As far as I know, there is no html specific data type for sql server. I would just use varchar and use an escape character to escape any characters that are not allowed. You should still find that it prints the line of information as html on the page and make it dynamic if need be. Hope this helps!

    Originally posted by lmod
    As I said before I am a newbie to the world of SQL Server and Transact SQL so here is my question. I want to store pics and a link to a specs page in a database but from my research on storing pics in a db I am finding that this is not a good idea. So I figured that I would try to store the url of the pic itself and dynamicaly insert that into my web apps. The problem is that inorder for this to work I think I need to include the HTLM tags
    in the info stored in the db table. What data type would I use for this or am I way off the planet with this method. Please let me know

  3. #3
    Join Date
    Dec 2002
    Location
    Antwerp, Belgium
    Posts
    227
    no escapes are necessary to store an url in a varchar column.
    I don't know what you are trying to achieve, but I would suggest the following to store only the file name for the picture and only the html page name for the specs page. Then store the path to the pictures and the path (can either be a directory on the server or the relative path of a web site) in a separate table. You will need extra queries, but no redundant information is stored and afterwards it's easier to change the directory.
    Johan

Posting Permissions

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