• I may be getting confused with what you're saying..

    But all of this works fine

    select @@rowcount-- check this one out

    select @@rowcount -- check this one out

    select @@rowcount -- check this one out

    select @@rowcount

    -- check this one out

    These would not work

    select @@rowcount- - check this one out

    select rowcount -- check this one out

    select @@rowcount -

    - check this one out

    select @@rowcount -- check

    this one out

    We've a policy at work to use /* */ for comments where possible in case peeps run comments over a line... but it's also a pain in the backside if you want to comment out a block with these already in.

    What I've found a bit weird is, if you run SELECT @@ROWCOUNT by itself in a completely fresh window then you get 1 returned... slightly odd behaviour? For example run the below script, I've used different commenting in case of line wrapping.

    SELECT @@ROWCOUNT /* Will return 1, even though we've not previousiy run a statement */

    SELECT 1 WHERE 2 = 1 /* Will an empty record set */

    SELECT @@ROWCOUNT /* Will return 0 as expected as the previous statement returned no rows */

    SELECT @@ROWCOUNT /* Will return 1 as the previous statement returned a row i.e of 0 */