Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
Indexing Service
SQL Query Language
 Query Syntax of SQL Query Language
 
Query Syntax of SQL Query Language

A typical sequence of statements in the SQL query language consists of the following.

SET Property_Name_Clause | Rank_Method_Clause
...
CREATE VIEW #View_Name
  AS SELECT Select_List
            FROM_Clause
...
SELECT Select_List | *
       FROM_Clause
       [ WHERE_Clause ]
       [ ORDER_BY_Clause ]

SQL statements can be submitted individually, or batched together. The following table lists the component statements and clauses in their usual order of use and briefly summarizes each.

Statement or ClauseDescription
SET statementMaps document-specific properties to column names or selects a ranking method for content searches.
CREATE VIEW statementAssociates a subset of properties with a user-defined virtual table name that can then be used to satisfy queries. Several predefined views can be used.
SELECT statementRetrieves rows by specifying the columns of interest, the scope (the set of documents) for the search, and the search criteria.
FROM clausePart of the SELECT statement that defines the query scope by specifying the documents on which to perform the search.
WHERE clauseOptional part of the SELECT statement that specifies the rows in the virtual table that make up the resulting rowset.
ORDER BY clauseOptional part of the SELECT statement that sorts the rows returned in the rowset according to a specified set of criteria.
Batched statementsAllow setting and executing several SQL statements, optionally separated by semicolons, as one command.

 

© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker