Welcome to the
DevGuru Transact-SQL Syntax Diagrams Quick Reference
guide. This guide is designed to present the syntax structure and a brief definition of each code element in the four most important statements in Transact-SQL:
DELETE
INSERT
SELECT
UPDATE
This is accomplished by the use of blue and red colored text and pop-up windows that appear when you mouse-over the words in the syntax diagram. The key to the colored text is at the bottom of this page and all other pages. The pop-up windows are best viewed using Internet Explorer versions 4.x, 5.x, and beta IE6, and Netscape Communicator version 4.x. (The pop-up windows do not appear on Opera or Netscape 6.)
Transact-SQL, which is commonly referred to as T-SQL or TSQL, is a sophisticated dialect of SQL used by Microsoft in both SQL Server 7 and SQL Server 2000. T-SQL is loaded with enhanced features that takes it far beyond the basic ANSI SQL 92 standard. (Note Microsoft's Access uses
Jet SQL
, which can be described as a less-advanced dialect of SQL as compared to T-SQL.)
The
Guru
recommends reading
Beyond the Basics with SQL
for an explanation of some of the advanced features of Transact SQL.
When an application communicates with SQL Server, it does so by sending Transact-SQL statements. There are four fundamental types of statements. The most important is the SELECT, whose purpose is to retrieve data from one or more tables. The other three are INSERT which adds new records (rows of data) to a table, DELETE which removes records from a table, and UPDATE which allows you to update the individual fields (columns) in a record. Queries created using these four statements allow the basic manipulation, retrieval, and storage of data in a relational database.
This Quick Reference follows the recommended coding convention of capitalizing keywords (such as SELECT, WITH, GROUP BY, etc.) in queries. This convention helps make a query more readable. However, Transact-SQL is not case sensitive.
Key to blue and red text in syntax diagram
KEYWORDS
Keywords are denoted with upper case letters. Obey the spelling.
variables
All user-defined values are denoted with lower case letters.
...,
n
Signifies that there can be more than one value in a comma delimited list. Note that the dots and
n
are not part of the code and must not appear in the SQL query.
...
n
Signifies that there can be more than one value in a blank space delimited list. Note that the dots and
n
are not part of the code and must not appear in the SQL query.
{ }
Signifies that all, or some portion, of the code elements between the braces are required elements and must appear in the SQL query. Note that these braces are not part of the code and must not appear in the SQL query.
[ ]
Signifies that the code elements between the square brackets can optionally appear in the SQL query, but are not required. Note that these brackets are not part of the code and must not appear in the SQL query.
|
The OR symbol signifies that you may use only one of the code elements or values from the possible choices. Note that this symbol is not part of the code and must not appear in the SQL query.
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information