![]() |
![]() |
Transact-SQL is central to the use of Microsoft® SQL Server™. All applications that communicate with SQL Server do so by sending Transact-SQL statements to the server, regardless of the application's user interface.
Transact-SQL is generated from many kinds of applications, including the following.
This table contains the more important clauses and functions of Transact-SQL.
Clause/Function |
Description |
SELECT Clause |
Specifies the columns to be returned by the query. |
FROM Clause |
Specifies the table(s) from which to retrieve rows. The FROM clause is required except when the select list contains only constants, variables, and arithmetic expressions (no column names). |
WHERE Clause |
Specifies a search condition to restrict the rows returned. |
GROUP BY Clause |
Specifies the groups into which output rows are to be placed and, if aggregate functions are included in the SELECT clause <select list>, calculates a summary value for each group. When GROUP BY is specified, either each column in any non-aggregate expression in the select list should be included in the GROUP BY list, or the GROUP BY expression must match exactly the select list expression. |
AND Function |
Combines two Boolean expressions and returns TRUE when both expressions are TRUE. Used when there are more than one logical operator in a statement - AND operators are evaluated first. Use parentheses to change the order of evaluation. |
OR Function |
Combines two conditions. Used when there are more than one logical operator is in a statement - OR operators are evaluated after AND operators. Use parentheses to change the order of evaluation. |
LIKE Function |
Determines whether or not a given character string matches a specified pattern. A pattern can include regular characters and wildcard search characters. During pattern matching, regular characters must match exactly the characters specified in the character string - wildcard characters, however, can be matched with arbitrary fragments of the character string. Using wildcard search characters makes the LIKE operator more flexible than using the = and != string comparison operators. If any argument is not of character string data type, Microsoft® SQL Server™ converts them to character string data type, if possible. |
COUNT Field Function |
Returns the number of items in a group. |
DATADIFF Field Function |
Returns the number of date and time boundaries crossed between two specified dates. |
MAX Field Function |
Returns the maximum value in the expression. |
MIN Field Function |
Returns the minimum value in the expression. |
Further Reference
Reference the following web site for further information about including other functions in the Profile.