On Tue, May 25, 2010 at 3:36 PM, Cox, Ed <[email protected]> wrote: > I'm using the J ODBC driver to connect to SQL Server. I'm finding that > queries > that I run are returning unwanted trailing blanks in all fields. For example > from > a table field defined as nvarchar(50) I am getting lengths of 100 returned, > most > of which are spaces as the end. From temp tables I am getting returned > lengths > of 1000 on data originally sourced from a table field of nvarchar(500). So > there > seems to be a 2 to 1 increase - perhaps due to the Nvarchar field. But the > root > issue is why am I getting this in the first place? It persists even if I use > RTRIM() > in the query.
Without further details, it is very difficult to say what is happening here. For example, one possibility is that you are unboxing the results, in which case you will probably have an array of characters where rows are padded so that they can all be the same length. If this is your issue you would need to deal with unboxing differently. For example, one possibility is that your table was created with set ansi padding off (see http://msdn.microsoft.com/en-us/library/ms187403.aspx). If this is your issue you would have to change that setting in your database and recreate your table. Other possibilities include your query and your connection though offhand I would be less likely to suspect them. FYI, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
