1 goto statement
IF 12>9
GOTO Print1
ELSE
GOTO Print2
Print1:print ' performed the process 1 '
--goto theend
Print2:print ' performed the process 2 '
GOTO theend
Print3:print ' performed the process 3 '
Theend:print ' Process end ';
2 case and then ELSE End statement
SELECT CONVERT (NVARCHAR, GETDATE (), 121) Date, Case MONTH (GETDATE ()) when ' one ' then ' 11 ' if ' Then ' 12 '
ELSE SUBSTRING (' 1,234,567,890 ', Month (GETDATE ()), 1) + ' month ' END month
3 WAITFOR Statements
--==========================================================================
--1, WAITFOR statement
--The DESC:WAITFOR statement is used to defer subsequent code execution, or wait until a specified time to execute subsequent code
--==========================================================================
Additional examples:
There are two uses:
1, delay after a period of time to execute
Like what:
WAITFOR DELAY ' 00:00:05 '
print ' delay 5 seconds to execute! ‘
--Execute print after 5 seconds
2. When the designation is executed
Like what:
waitfor time ' 21:17 '
print ' 21:17 execution '
SQL Process Control Statements