• Iulian -207023 (10/29/2010)


    Great question, thanks

    Here is a reference to the compound operators: http://msdn.microsoft.com/en-us/library/cc645922.aspx

    Regards,

    Iulian

    Thanks for the reference, but it still doesn't explain the question. In the question =+ is used, while the compound operator used in SQL Server is +=. I've done a little research, and it seems that a++ is the post-increment operator and ++a the pre-increment operator.

    (see http://bytes.com/topic/c/answers/506780-difference-between-pre-increment-post-increment).

    So it seems that the explanation of the question is wrong, as it states that the pre-increment operator is not used in SQL Server. SQL Server uses however a compound operator, meaning addition and assign, not incrementing the value. It still remains unknown to me why SQL Server ignores the + in =+ instead of giving a syntax error.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP