• Christian Buettner-167247 (3/28/2011)


    paul.james 64212 (3/28/2011)


    OK, can somebody suggest why this returns "Msg 102, Level 15, State 1, Line 4 Incorrect syntax near '='." on my 9.0.4207 SQL server?

    declare @i tinyint

    SELECT @i = 0

    while @i < 255

    SELECT @i+=1

    SELECT @i

    Msg 102, Level 15, State 1, Line 4

    Incorrect syntax near '='.

    Because this syntax is not supported in SQL Server 2005.

    Ah, ok, DOH! Too much to ask for SQL server version numbers and product names to make any sense I suppose!