Discussion Locked

Understanding Syntax explanations

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Please excuse me as I'm kind of new to this programming stuff.

I'm working with SQL and using the online Server Books help.

For instance, I was researching how to add rows to a table and found this...

Syntax
INSERT [ INTO]
{ table_name WITH ( < table_hint_limited > [ ...n ] )
| view_name
| rowset_function_limited
}

{ [ ( column_list ) ]
{ VALUES
( { DEFAULT | NULL | expression } [ ,...n] )
| derived_table
| execute_statement
}
}
| DEFAULT VALUES

< table_hint_limited > ::=
{ FASTFIRSTROW
| HOLDLOCK
| PAGLOCK
| READCOMMITTED
| REPEATABLEREAD
| ROWLOCK
| SERIALIZABLE
| TABLOCK
| TABLOCKX
| UPDLOCK
}

Can anyone tell me how to find reference-type material to explain what all the pipes, brackets, etc. are and how they relate to how the syntax is being explained?

Many thanks in advance!

N. Brewer

3 replies

by haris

Here is how to read it:

pipes mean OR
square brackets "[..]" surround optional items
The angle brackets distinguish syntax rules names (also called non-terminal symbols) from terminal symbols which are written exactly as they are to be represented.
repetitive items (zero or more times) are enclosed in meta symbols {}.

This discussion is closed to new replies.