• Christopher Stobbs (8/24/2009)


    I agree with the last two posts. I got it wrong cause I can't mind read.

    I can think of many examples where the cast is not implicit...

    Well, I disagree with those two posts and with you. Is the conversion from tinyint to int implicit, explicit, or forbidden? It's implicit. But as far as I can see you are telling me that because it is perfectly valid to write

    declare @integer int

    declare @octet tinyint

    select @octet = 0

    select @integer = cast (@octet as int)

    the conversion from tinyint to int is explicit. Well, I think that's a very strange point of view.

    The descriptions in BOL seem to me quite clear. In fact there's even a nice matrix showing which conversions are implicit, which explicit, and which forbidden. It's been there since SQL 2000. It's still there in SQL 2008 R2.

    Tom