Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2002
    Posts
    229

    Unanswered: Text datatype incompatible with itself?

    Now, what does THIS mean??

    "Data types text and text are incompatible in the equal to operator"

    (I'm doing a CAST() to convert a quoted string to
    Text, which is the data type of a column)

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    One of the major reasons I do not allow text/image datatypes in my shop. SQL 2000 can not compart text to text. Probably because you would need up to 4GB of memory to do the comparison. See the artice "Managing ntext, text, and image Data" in BOL.
    Quote Originally Posted by BOL
    When the ntext, text, and image data values get larger, however, they must be handled on a block-by-block basis. Both Transact-SQL and the database APIs contain functions that allow applications to work with ntext, text, and image data block by block.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You do not need to cast quoted strings before inserting them into a text column. Varchar and Char datatypes are implicitly converted to Text datatypes.
    If it's not practically useful, then it's practically useless.

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

  4. #4
    Join Date
    Jul 2002
    Posts
    229
    Quote Originally Posted by MCrowley
    One of the major reasons I do not allow text/image datatypes in my shop. SQL 2000 can not compart text to text.
    Aha... well I'm pretty sure the guy who created this table
    has no idea about what datatype 'text' actually is.
    There's no reason for using it in this table.

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Thats very likely, and very common. Also, the "text" datatype in MS Access is equivalent to the "varchar" datatype in SQL Server, so a lot of noob developers use the text datatype when upscaling from Access to SQL Server.
    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
  •