Results 1 to 10 of 10

Thread: Making a database, so one field can hold *unlimited length? *slvd*

  1. #1

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    Making a database, so one field can hold *unlimited length? *slvd*

    hey ya,

    How do i make my database table, so as one field, can hold about 500 - 1000 Chars?

    currently i have a table, which i need to store URLs in, but a URL Like:
    http://thewalks.ods.org:88/modules.p...stics&op=Stats

    is being cut down to:
    http://thewalks.ods.org:88/modules.php?name=Statis

    how is it i can make it hold a larger length?

    Possible or?

    TNX
    Last edited by wpearsall; Nov 4th, 2002 at 08:47 PM.
    Wayne

  2. #2
    Frenzied Member Mega_Man's Avatar
    Join Date
    Mar 2001
    Location
    North of England, South-East of Iceland
    Posts
    1,067
    If it'a an Access table, make the field of type 'Memo'
    If it's SQL then just make it text (not Varchar) and it will create a pointer to another area which allows 65535 characters.

    Mega.
    "If at first you don't succeed, then skydiving is not for you"

  3. #3

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    kool, tnx, know that was there

    OK,,, Select * From _ Where This IS "this" and This IS NOT "this"

    The MySQL Version:

    "SELECT * FROM table WHERE this1='This' AND this2 !='This'"

    How do i do that with access?...

    The IS NOT part?
    Wayne

  4. #4
    Frenzied Member Mega_Man's Avatar
    Join Date
    Mar 2001
    Location
    North of England, South-East of Iceland
    Posts
    1,067
    VB Code:
    1. "SELECT * FROM table WHERE this1 = 'This' AND NOT(this2 ='This'")
    Mega.
    "If at first you don't succeed, then skydiving is not for you"

  5. #5

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    : wow, VB is really, practical huh

    Tnx
    Wayne

  6. #6
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    The "not equal" operator (<>) will also work in Access as well as many other DBMS'.
    "It's cold gin time again ..."

    Check out my website here.

  7. #7
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    How do i make my database table, so as one field, can hold about 500 - 1000 Chars?
    If it's SQL then just make it text (not Varchar) and it will create a pointer to another area which allows 65535 characters.
    In SQL 7.0 and up a varchar can hold 8000 characters. More than enough for what wpearsall needs.

  8. #8
    Frenzied Member Mega_Man's Avatar
    Join Date
    Mar 2001
    Location
    North of England, South-East of Iceland
    Posts
    1,067
    In SQL 7.0 and up a varchar can hold 8000 characters. More than enough for what wpearsall needs.
    True.. but why would you want to do that?
    IF you set a Varchar to be 8000 characters, you are telling SQL server to use an entire page for that field. A helluva waste of database space if your varchar field only has 100 characters in it.

    Mega.
    Last edited by Mega_Man; Nov 6th, 2002 at 11:41 AM.
    "If at first you don't succeed, then skydiving is not for you"

  9. #9
    Frenzied Member seoptimizer2001's Avatar
    Join Date
    Apr 2001
    Location
    Toledo, Ohio USA GMT -5
    Posts
    1,075
    Originally posted by Mega_Man
    True.. but why would you want to do that?
    IF you set a Varchar to be 8000 characters, you are telling SQL server to use an entire page for that field. A helluva waste of database space if your varchar field only has 100 characters in it.

    Mega.
    Yes, but it depends on how the field will be used, some functions won't work on fields with data type text. For one I know the Replace() function will not work. But I agree about saving space if most of the records will not be holding the same amount of data.
    seoptimizer2001
    VB 6.0, VC++, VI, ASP, JavaScript, HTML,
    Perl, XML, SQL Server 2000

    If God had intended us to drink beer, He would have given us stomachs.


    Please use the [code] and [vbcode] tags in your posts!
    If you don't know how to use them please go HERE!


  10. #10
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    IF you set a Varchar to be 8000 characters, you are telling SQL server to use an entire page for that field. A helluva waste of database space if your varchar field only has 100 characters in it.
    A Varchar field is variable length. So a field that has only 100 characters and is defined as 8000 only takes up 103 bytes not 8003. (There is 3 bytes of overhead for every varchar column).

    But you are right one must weigh the cost of whether to use a Varchar or Text column.

Posting Permissions

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



Click Here to Expand Forum to Full Width