Examples: Azure Synapse Analytics and Analytics Platform System (PDW) Example IF DATENAME(weekday, GETDATE()) IN (N'Saturday', N'Sunday')įor more examples, see ELSE (IF.ELSE) (Transact-SQL). The limit to the number of nested levels depends on available memory. IF tests can be nested after another IF or following an ELSE. When this construct is used in a stored procedure, it is frequently used to test for the existence of some parameter. ![]() RemarksĪn IF.ELSE construct can be used in batches, in stored procedures, and in ad hoc queries. To define a statement block, use the control-of-flow keywords BEGIN and END. Unless a statement block is used, the IF or ELSE condition can affect the performance of only one Transact-SQL statement. Is any Transact-SQL statement or statement grouping as defined by using a statement block. If the Boolean expression contains a SELECT statement, the SELECT statement must be enclosed in parentheses. ![]() Is an expression that returns TRUE or FALSE. To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |