Page 1 of 1

SQLServer varchar returning truncated string

Posted: Tue Sep 30, 2008 4:31 am
by ZDC
Hi,

I am reading a varchar(8000) column from MSSQL Server 2000 using SQLServer enterprise Stage. The actual value in the column is 2300 characters. The output from the job is a truncated string of 255 characters followed by char(0) characters. The total character count in the output is 8000. sorry i couldn't paste the string here becoz of char(0).

When i do a substring in the query again only the first 255 chars are ok.
Any suggestions ?

Thanks in advance.

Posted: Tue Sep 30, 2008 5:00 am
by ray.wurlod
Use LongVarChar. Under ODBC standards the maximum size of a VarChar is 255 characters.

All complaints to billg@microsoft.com (because ODBC is a Microsoft standard).

Posted: Tue Sep 30, 2008 5:51 am
by ZDC
I am afraid it is giving me the same result with LongVarchar as well :cry:

Posted: Tue Sep 30, 2008 6:00 am
by ray.wurlod
Perhaps your driver does not properly support LongVarChar. Try using a different client, perhaps MS Access, from the DataStage server.

Posted: Wed Oct 01, 2008 4:50 am
by ZDC
Nothing seems wrong with the ODBC con . I have checked it using C# code and it returns the proper value and not a truncated one.
any other setting i should check for ?