Transact-SQL (T-SQL) is Microsoft's and Sybase's proprietary extension to the SQL (Structured Query Language) used to interact with relational databases.
Keywords for flow control in Transact-SQL include BEGIN and END, BREAK, CONTINUE, GOTO, IF and ELSE, RETURN, WAITFOR, and WHILE.
(Note: This code assumes that Sunday is configured as the first day of the week in the @@DATEFIRST setting.)
Beginning with SQL Server 2005,[1] Microsoft introduced additional TRY CATCH logic to support exception type behaviour.
This behaviour enables developers to simplify their code and leave out @@ERROR checking after each SQL execution statement.