varchar vs. char + trim
am 17.07.2006 21:01:56 von Mike
OK I've got a database that a programmer setup with char columns
instead of varchar, because char columns are more efficient than
varchar to process. Whenever I list the data on a webpage, however, I
have to call trim to get rid of the whitespace. It would seem to me
that calling trim() for each record you want to show would slow down
things more than the gains you get from the fixed character length.
Anyone know which is actually faster?
regards,
Mike
Re: varchar vs. char + trim
am 17.07.2006 22:02:02 von reb01501
mike wrote:
> OK I've got a database that a programmer setup with char columns
> instead of varchar, because char columns are more efficient than
> varchar to process. Whenever I list the data on a webpage, however, I
> have to call trim to get rid of the whitespace. It would seem to me
> that calling trim() for each record you want to show would slow down
> things more than the gains you get from the fixed character length.
> Anyone know which is actually faster?
>
Your programmer is still in the SQL 6.5 world. There is no longer any
real performance advantage to using char instead of varchar.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.