Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2002
    Location
    Florida
    Posts
    2

    Unanswered: <Long Text> Entry

    Hi all,

    Newbie here, just wanted to get that out of the way first
    and foremost.

    Im trying to set up a DB in SQL 2000 that allows me to enter
    lots of text into a column.

    I read one site where it said to use the NTText datatype with a length
    of 16. I did that, but everytime I enter alot of text into that column
    I get <Long Text> and I dont know how to output that or even
    read it.

    Do any of you guys know how to either:

    1. get the text out of the <long text> or
    2. a better way to store that much data.

    Thank you in advance!!!

    REZ

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    NTTEXT?

    I assume you mean NTEXT.

    What interface are you using to display the data? Please don't answer "Enterprise Manager's table viewer".
    If it's not practically useful, then it's practically useless.

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

  3. #3
    Join Date
    Aug 2005
    Posts
    75
    for viewing, the quick way that I do it in QA is to go into the result options and set the target to "Results to Text" and up the Max characters per column to 8192. Then in my query, I select only that one field (one row at a time to keep it readable). This is only for quick viewing though (one of the applications I manage has a lot of xml data in ntext fields). That takes care of about 95% of my needs.


    But blindman is right - EM is not the ideal way to go about managing your data and database (for a multitude of reasons). Your best bet is to get more acquainted with the actual SQL code that goes on behind the scenes. It makes for much more versatile (and faster) database management.
    Last edited by jeebustrain; 03-12-08 at 11:51.

  4. #4
    Join Date
    Feb 2005
    Location
    Utah
    Posts
    73
    Most query tools, QA and EM included, have limits on the amount of data they will return for a given field. In this case you're using a text field that can hold something like 2GB for a text datatype, so probably 1GB for NText. Even if you set the query tool to its max, you're probably not going to get all of the text back. I believe that QA will truncate the text at your limit and EM will just return a <Long Text> value.
    Dandy
    Aspiring Database Dwarf

  5. #5
    Join Date
    Nov 2002
    Location
    Florida
    Posts
    2
    Im using enterprise manager! j/k
    I did have a good laugh about that one though (blindman).

    Actually im just running a select query in ASP
    and response.writing the contents of that row (which in SQL Server shows as <long text> and nothing.

    It wont show the data.

    What Data Type would you guys use for a long message type of a thing.
    example would be I want to save notes (they can get big) on my site.

    Thanks for responses.

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I'd use text or Ntext, but your problem seems to be related to ASP, not SQLSVR.
    If it's not practically useful, then it's practically useless.

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

  7. #7
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I wouldn't

    You need to say what version

    If it's 2k5, the varchar(max)

    If it's 2k, then key, identity, varchar(8000)
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Will varchar(max) not have the problem if it exceeds the page length (~8000kb) as it is then removed from the database page and stored "externally" just like text, xml, blobs etc?
    George
    Home | Blog

  9. #9
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by Brett Kaiser
    If it's 2k5, the varchar(max)
    Conceded.
    Quote Originally Posted by Brett Kaiser
    If it's 2k, then key, identity, varchar(8000)
    Disputed.
    If it's not practically useful, then it's practically useless.

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

Posting Permissions

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