• DECLARE @a INT

    DECLARE @b-2 DATETIME

    SET @a = @b-2

    The above code executed successfully for me in SQL 2005 but gave the error listed in the answer when I ran it in SQL 2000**. So I think it is dependent on the SQL version, at least in the form expressed above.

    - webrunner

    ** Version: Microsoft SQL Server 2000 - 8.00.194 (Intel X86)

    Aug 6 2000 00:57:48 Copyright (c) 1988-2000 Microsoft Corporation

    Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 3)

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html