You can use SQL grammar to query a database and to insert, update, and delete rows in tables in a Microsoft SQL Server Compact 3.5 database.
The syntax diagrams in this reference use the following conventions.
SQL Server Compact 3.5 keywords.
User-supplied parameters of SQL Server Compact 3.5 syntax.
| (vertical bar)
Separating syntax items within brackets or braces. You can choose only one of the items.
[ ] (brackets)
Optional syntax items. Do not type the brackets.
Required syntax items. Do not type the braces.
Indicating that the preceding item can be repeated n number of times. The occurrences are separated by commas.
Indicating that the preceding item can be repeated n number of times. The occurrences are separated by blanks.
Database names, table names, column names, index names, stored procedures, utilities, data type names, and text that must be typed exactly as shown.
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 place within a statement. Each location in which the block of syntax can be used is indicated with the label enclosed in chevrons: <label>.
You can use identifiers, delimiters, and comments when you query a database in SQL Server Compact 3.5.
The name of a database object is known as an identifier. The object name is created when the object is defined. The identifier is used to reference the object.
With SQL Server Compact 3.5, because you must connect to a database that already exists in the device before you can run queries, you do not have to qualify object identifiers with owner, database, or server names. You can reference objects in one of these ways:
You must delimit identifiers when they do not comply with the rules for the format of regular identifiers or when reserved keywords are used as identifiers. The following table summarizes the usage of delimiters in SQL Server Compact 3.5.
Usage in SQL Server Compact 3.5
Brackets [ ]
Double quotation marks " "
Single quotation marks ' '
String data values
You can include text strings that should not be executed in the code as comments. Comments can be used to document code or to temporarily disable certain parts of a SQL statement.
You can delineate text as comments using either of the following styles: