it is defined in SQL 2011 part 4 paragraph 14.4 "SQL variable declaration"
ISO/IEC 9075-4: Persistent Stored Modules (SQL/PSM)
makes SQL computationally complete by specifying the syntax and semantics of additional SQL-statements.
Those include facilities for:
...
- The assignment of the result of expressions to variables
...
- The declaration of local variables
usage of local variable will help to avoid using nonstandart syntax similar to CURRENT VALUE FOR, SCOPE_IDENTITY(), @@IDENTITY, or call to ident_current(name) function - (short description of them)
it is defined in SQL 2011 part 4 paragraph 14.4 "SQL variable declaration"
ISO/IEC 9075-4: Persistent Stored Modules (SQL/PSM)
makes SQL computationally complete by specifying the syntax and semantics of additional SQL-statements.
Those include facilities for:
...
...
usage of local variable will help to avoid using nonstandart syntax similar to CURRENT VALUE FOR, SCOPE_IDENTITY(), @@IDENTITY, or call to ident_current(name) function - (short description of them)