I'm running SQL Server 2K (sp3a) and when I run the following query (in
query analyzer):
SELECT id, LEN(ForeignWord) as Length, ForeignWord
FROM Words
WHERE Language ='Thai' and LEN(ForeignWord) > 300
ORDER BY Length desc
I receive the following results:
id Length ForeignWord
------- ----------- -----------
34756 445 เ#...truncated at 255
34839 412 เ$...truncated at 255
37613 350 โ#...truncated at 255
37808 315 โ#...truncated at 255
38140 315 โ#...truncated at 255
(The ForeignWord field is defined as varchar(1000))
Note that even though the server says that the lengths are in excess of
255 characters, the results are all truncated at 255 characters.
I read that SQL Server 6.5 and 7.0 had some issues related to native
access versus OleDb or ODBC, but this is Server 2K patched with the
latest updates.
Any idea why my varchar fields are being truncated?
-- Rick
Here is my table definition:
CREATE TABLE [Words] (
[ID] [bigint] IDENTITY (1, 1) NOT NULL ,
[Language] [varchar] (50) NOT NULL ,
[Module] [int] NOT NULL ,
[Lesson] [int] NOT NULL ,
[EnglishWord] [varchar] (1000) NOT NULL ,
[ForeignWord] [varchar] (1000) NOT NULL ,
[Note] [varchar] (2000) NULL ,
[Military] [tinyint] NOT NULL CONSTRAINT [DF_Table1_Military]
DEFAULT (0),
[Supplemental] [tinyint] NOT NULL CONSTRAINT [DF_Table1
_Supplemental] DEFAULT (0),
[SoundFileName] [varchar] (1000) NULL
)