• Sean Lange (9/2/2015)


    Steve Jones - SSC Editor (9/2/2015)


    I do agree with the = and try to use it, precisely because complex code becomes hard to read when the name is buried far to the right of my screen. However my habit is "as", so I struggle to change and get some inconsistent code.

    Assuming you put one and only one column on each row of text this shouldn't happen except for the occasional really complex string manipulation or complex calculation.

    My main argument against using ColumnName = Column is that it looks like assignment and if you really do mean to be assigning a value to a variable and you happen to forget the @ it is really hard to find the problem. Just my 2¢.

    It is an assignment, albeit a metadata one.

    I'm not sure what you mean by the @? Are you saying if you write

    select @i = mycol from mytable

    and you forget the @ there? I think that's a simple find.