varchar vs. char + trim

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
Mike [ Mo, 17 Juli 2006 21:01 ] [ ID #1394587 ]

Re: varchar vs. char + trim

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.
reb01501 [ Mo, 17 Juli 2006 22:02 ] [ ID #1394588 ]
Webserver » microsoft.public.inetserver.asp.db » varchar vs. char + trim

Vorheriges Thema: uploading file into sql 2005 using .asp
Nächstes Thema: Moving to a previous record