Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read msdn's t-sql syntax explanation?

msdn.microsoft.com has tips, examples and explanantion on all kinds of t-sql code. But one does wrubs his head with the explanation given. For example, how to interpret the following (taken from here):

[ WITH <common_table_expression> [ ,...n ] ]

<common_table_expression>::=
    expression_name [ ( column_name [ ,...n ] ) ]
    AS
    ( CTE_query_definition )

How to read msdn's t-sql syntax explanation?

like image 640
cybork Avatar asked Feb 07 '26 11:02

cybork


1 Answers

See 'Transact-SQL Syntax Conventions (Transact-SQL)' on https://msdn.microsoft.com/en-us/library/ms177563.aspx about the conventions for their syntax. Regarding the example:

[ ] (brackets) Optional syntax items. Do not type the brackets.

<label> ::= The name for a block of syntax. This convention is used to group and label sections of lengthy syntax or a unit of syntax that can be used in more than one location within a statement. Each location in which the block of syntax can be used is indicated with the label enclosed in chevrons: .

[,...n] Indicates the preceding item can be repeated n number of times. The occurrences are separated by commas.

A set is a collection of expressions, for example ; and a list is a collection of sets, for example .

{ } (braces) Required syntax items. Do not type the braces.

like image 103
cybork Avatar answered Feb 09 '26 07:02

cybork



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!