Problem with trim query

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Microsoft SQL Server
Post Reply
Manolo
Posts: 1
Joined: Tue 25 Mar 2014 16:45

Problem with trim query

Post by Manolo » Tue 27 May 2014 12:08

Hello,
I have to work with an old database that uses CHAR and TEXT fields. I need to remove the ending blank spaces of those fields so I have tried with RTRIM() but it is not allowed for TEXT fields. After that I tried with RTRIM(Convert(NVARCHAR(max),"column")) and it does the job, but it always sets the AllowDBNull column property to TRUE.

Is there an easy way to acomplish this? What can I do?

Pinturiccio
Devart Team
Posts: 2418
Joined: Wed 02 Nov 2011 09:44

Re: Problem with trim query

Post by Pinturiccio » Thu 29 May 2014 14:55

You can perform a script, trimming trailing spaces for each string in the database. After this you will not need to trim strings in each query.

We will also investigate the possibility to add a property that will enable trimming all the data when fetching them and post here about the results as soon as possible.

Post Reply