• Slight quibble with Oleg's reply.

    "When omitting the size of either char or varchar, the default size is 30 for both" implies that the default size for varchar or char in a declare, cast or convert would be 30. This is correct for char and varchar but for declare the default size is 1. If the problem had been specified with no lengths in the declare statements then the solution would have been 1, 1, 3, 30.

    I don't know why there's this difference between declare and cast/convert

    Andy

    --------------------------------------------------------------

    “Doubt is not a pleasant condition, but certainty is absurd.” Voltaire