Results 1 to 6 of 6

Thread: varchar length

  1. #1
    Join Date
    Mar 2004
    Location
    Nepal
    Posts
    2

    Angry Unanswered: varchar length

    i have problem regarding the row length and varchar.
    my problem is on every new row i have +6 more character on one of my field then the last record. and BOL says i can only have 8060 character per row.
    What i can not use the full lenght of varchar(8000) on field.

    Can anybody help?????????

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Every
    Every new
    Every new row
    Every new row has
    Every new row has six
    Every new row has six more
    Every new row has six more characters?
    Every new row has six more characters? Why
    Every new row has six more characters? Why ARE
    Every new row has six more characters? Why ARE you
    Every new row has six more characters? Why ARE you doing
    Every new row has six more characters? Why ARE you doing this?!

    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    Do you have anymore fields in the table? Why don't you post a CREATE TABLE statement and let us look at it. I would question as blindman did why you're doing this in the first place though.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  4. #4
    Join Date
    Mar 2004
    Location
    Nepal
    Posts
    2

    Red face

    the table something look like this

    CREATE TABLE dbo.tblUser
    (
    uid INT NOT NULL, -- user id
    puid INT NOT NULL, --parent user id
    ttree VARCHAR(8000) NOT NULL, - and user tree
    )

    On one column one is userid and parent id (the upper userid). the puid is there for every except the starting userid and i want to make tree like this


    uid puid ttree
    100 0 0
    101 100 100
    102 101 100101
    103 102 100101102


    there is any way to generate sub "ttree" from query????????????????????

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    What are you going to do with the ttree column?

    Wait. Don't answer that.

    WHATEVER you are going to to with the ttree column, there is a better way to do it than however you were planning to do with the ttree column whatever it is that you are trying to do with ttree but don't really need to do that way.

    Maybe you could add another column called tttree. Or ttreee? And go from there: ttttree, tttttree, adding another t for each, well, whatever.

    No, seriously. You appear to be implementing some recursive logic, and if you explain what your goal is then somebody here can offer an alternative (read "better") method. What you got is not gonna work.

    And are you really in Nepal? I went to high-school with the nephews of the Dali Lama. For whatever thats worth...
    Last edited by blindman; 07-14-04 at 01:30.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  6. #6
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    9
    You can only have 8060 bytes per row. So if you have two varchar fields with 8000 characters, you can not fill both for the same record.

    So it seems that with your table structure, you shouldn't have any problems with memory restrictions.

    But I agree with the other comments, perhaps if you post what you actually want to do a better algorithm will be developed for you.

Posting Permissions

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