• EdVassie (7/2/2009)


    I have seen some poor database designs that have ignored this fact, with varchar(1), varchar(2), etc fields.

    Everybody always should use the RIGHT type.

    varchar(1) and char(1) are not similar nor interchangeable.

    Try this:

    declare @vc varchar(1)

    ,@c char(1)

    SET @vc = ''

    SET @C = ''

    print 'varchar[' + @vc + ']'

    print 'char [' + @C + ']'

    the result is very different:

    varchar[]

    char [ ]