• andy.roberts (10/4/2010)


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

    Nobody does, I think. πŸ™‚

    Probably for historical (hysterical?) reasons.

    But this difference has already been the subject of many QotD's, and this is also exactly why HΓ₯kan suggests (and I fully agree with him) that one should never rely on the default, but always explicitly declare the length.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/