#EDIR DATA#
DOCTYPE='BOOK' PUBLICID='-//SYBOOKS//Default DTD//EN' SYSTEMID=''DOCTYPE='book' PUBLICID='' SYSTEMID=''SYBASE SQL Server Quick Reference GuideSYBASE SQL Servername='trade' font='symbol' code='228'  charset='fontspecific'
Quick Reference GuideREMAP="titleBO--Body"SYBASE SQL Server SYBASE SQL Server Release 10.0REMAP="titleBO--Body"Document ID: 30200-00-1000-01REMAP="titleBO--Body"Change Level: 2REMAP="titleBO--Body"Last Revised: June 17, 1994Document ID: 30200-00-1000REMAP="discBO--Body"This publication pertains to SYBASE SQL Server Release 10.0 of the SYBASE database management software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of the agreement.Document OrdersREMAP="discBO--Body"Customers may purchase additional copies of any document or the right to make photocopies of documentation for their in-house use.REMAP="discBO--Body"To order additional documents or photocopy rights, U.S. and Canadian customers should call Customer Fulfillment at (800) 685-8225, fax (617) 229-9845.REMAP="discBO--Body"Customers in other countries with a U.S. license agreement may contact Customer Fulfillment via the fax number. All other international customers should contact their Sybase subsidiary or local distributor.REMAP="discBO--Body"Upgrades are provided only at regularly scheduled software release dates.REMAP="discBO--Body"© Copyright Sybase, Inc., 1989, 1994. All rights reserved.REMAP="discBO--Body"No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical or otherwise, without prior written permission of Sybase, Inc.Sybase TrademarksREMAP="discBO--Body"SYBASE, the SYBASE logo, SyBooks, APT-FORMS, Data Workbench, DBA Companion, Deft, GainMomentum, SA Companion, SQL Debug, SQL Solutions, SQR, Transact-SQL, and VQL are registered trademarks of Sybase, Inc. ADA Workbench, Adaptable Windowing Environment, Application Manager, Applications from Models, APT Workbench, APT-Build, APT-Edit, APT-Execute, APT-Translator, APT-Library, Build Momentum, Camelot, Client/Server Architecture for the Online Enterprise, Client/Server for the Real World, Configurator, DataServer, Data Workbench, Database Analyzer, DB-Library, Deft Analyst, Deft Designer, Deft Educational, Deft Professional, Deft Trial, Developers Workbench, Easy SQR, Embedded SQL, Enterprise Builder, Enterprise Client/Server, Enterprise Meta Server, Enterprise Modeler, Enterprise Momentum, Gain, GainExposure, Insight, Mainframe Access Products (MAP), Momentum, Movedb, Navigation Server, Net-Gateway, Net Library, Object Momentum, OmniSQL Gateway, Omni SQL Server, OmniSQL Access Module, Open Client, Open Gateway, Open Server, Open Solutions, PC APT-Execute, PC DB-Net, PC Net Library, Report Workbench, Report Execute, Open Server, Partnerships that Work, Replication Server, Resource Manager, RW-Display Lib, RW-Library, SA Monitor, Secure SQL Server, Secure SQL Toolset, SQL Code Checker, SQL Edit/TPU, SQL Edit, SQL Monitor, SQL Server, SQL Toolset, SQL Server/CFT, SQL Server/DBM, SQL Station, SQR Toolset, SQR Developers Kit, SQR Workbench, SYBASE Client/Server Interfaces, SYBASE Gateways, SYBASE SQL Lifecycle, Sybase Synergy Program, SYBASE Virtual Server Architecture, SYBASE User Workbench System 10, Tabular Data Stream, and The Enterprise Client/Server Company are trademarks of Sybase, Inc.REMAP="discBO--Body"All other company and product names used herein may be the trademarks or registered trademarks of their respective companies.Restricted Rights LegendREMAP="discBO--Body"Use, duplication or disclosure by the Government is subject to restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.REMAP="discBO--Body"Sybase, Inc., 6475 Christie Avenue, Emeryville, CA 94608REMAP="discBO--Body"ConventionsREMAP="BO--Body"The font and syntax conventions in this reference are as follows:PGWIDE=1 TOCENTRY="1"LBL="Table 1: "Font and Syntax ConventionsCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="20*"COLNAME="C2" COLWIDTH="31*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ElementCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ExampleVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Command names, command option 
names, utility names, utility flags, and 
other keywords are MOREINFO="NONE"bold.COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"select COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Database names, datatypes, file names, 
and path names are in italics.COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"master database COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Variables, or words that stand for values 
that you fill in, are in italics.COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"select column_name 
MOREINFO="NONE"from table_name 
MOREINFO="NONE"where search_conditionsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Parentheses are  typed as part of the 
command. COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"compute row_aggregateMOREINFO="NONE" (column_nameMOREINFO="NONE") COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Curly braces indicate that you must 
choose at least one of the enclosed 
options. Do not type the  braces. COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"{cash, check, credit} COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Brackets mean choosing one or more of 
the enclosed options is optional. Do not 
type the  brackets. COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"[anchovies] COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The vertical bar means you can  select 
only one of the options shown. COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"{die_on_your_feet | live_on_your_knees | 
live_on_your_feet} COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The comma means you can choose as 
many of the options shown as you like, 
separating your choices with commas to 
be typed as part of the command.COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"[extra_cheese, avocados, sour_cream] COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An ellipsis (...) means that you can repeat 
the last unit as many times as you like.COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"buy thing = price [cash | check | credit] 
 MOREINFO="NONE" [, thing = price [cash | check | credit]]...  You must buy at least one thing and give its price. You may 
choose a method of payment: one of the items enclosed in 
square brackets. You may also choose to buy additional 
things: as many of them as you like. For each thing you buy, 
give its name, its price, and (optionally) a method of 
payment.RENDERAS="SECT1"RENDERAS="SECT2"FormattingREMAP="BO--Body"SQL is a free-form language: there are no rules about the number of words you can put on a line, or where you must break a line. RENDERAS="SECT2"CaseREMAP="SY--Syntax" FORMAT="LINESPECIFIC"select column_namefrom table_namewhere search_conditions REMAP="BO--Body"In syntax statements, keywords (commands) are in normal font and identifiers and user-supplied words are in italics. You can disregard case when you type keywords: REMAP="BO--Body""SELECT" is the same as "Select" is the same as "select".ID="IN201"Expressionstypes ofRENDERAS="SECT3"ExpressionsREMAP="BO--Body"Several different types of expressions are used in SQL Server syntax statements. TOCENTRY="1"LBL="Table 2: "Types of Expressions Used in Syntax StatementsCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="5*"COLNAME="C2" COLWIDTH="12*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"UsageCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DefinitionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"expressionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Can include constants, literals, functions, 
column identifiers, variables or parametersCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"logical expressionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An expression that returns TRUE, FALSE or 
UNKNOWNCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"constant expressionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An expression that always returns the same 
value, such as "5+3" or "ABCDE"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"float_exprCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Any floating-point expression or expression 
that implicitly converts to a floating valueCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"integer_exprCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Any integer expression, or an expression that 
implicitly converts to an integer valueCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"numeric_exprCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Any numeric expression that returns a single 
valueCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"char_exprCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Any expression that returns a single 
character-type valueCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"binary_expressionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An expression that returns a single binary or 
varbinary valueNUMBER="1"Transact-SQL Commandsalter database 
Increases the amount of space allocated to a database.FORMAT="LINESPECIFIC"alter database database_name [on {default | database_device } [= size]    [, database_device [= size]]...] [log on { default | database_device } [ = size ]    [ , database_device [= size]]...] [with override][for load]alter table   
Adds new columns and constraints, changes constraints, or drops constraints on an existing table.FORMAT="LINESPECIFIC"alter table [database.[owner].]table_name {add column_name datatype    [default {constant_expression | user | null}]    {[{identity | null}]    | [[constraint constraint_name]        {{unique | primary key}            [clustered | nonclustered]            [with fillfactor = x] [on segment_name]        | references [[database.]owner.]ref_table             [(ref_column)]        | check (search_condition)}]}...    {[, next_column]}... | add {[constraint constraint_name]    {unique | primary key}        [clustered | nonclustered]        (column_name [{, column_name}...])        [with fillfactor = x] [on segment_name]    | foreign key (column_name [{, column_name}...])        references [[database.]owner.]ref_table            [(ref_column [{, ref_column}...])]    | check (search_condition)} | drop constraint constraint_name | replace column_name    default {constant_expression | user | null}}begin...end
Encloses a series of SQL statements so that control-of-flow language, such as MOREINFO="NONE"if ... else, can affect the performance of the whole group. FORMAT="LINESPECIFIC"begin     statement blockendbegin transaction
Marks the starting point of a user-defined transaction. FORMAT="LINESPECIFIC"begin {transaction | tran } [transaction_name]break
Causes an exit from a MOREINFO="NONE"while loop. MOREINFO="NONE"break is often activated by an MOREINFO="NONE"if test.FORMAT="LINESPECIFIC"while logical_expression     statement break     statementcontinuecheckpoint
Writes all "dirty" pages (pages that have been updated since they were last written) to the database device. FORMAT="LINESPECIFIC"checkpointclose
Deactivates a cursor.FORMAT="LINESPECIFIC"close cursor_namecommit
Marks the ending point of a user-defined transaction.FORMAT="LINESPECIFIC"commit [transaction | tran | work] [transaction_name]compute Clause
Generates summary values that appear as additional rows in the query results. This allows you to see the detail and summary rows in one set of results. You can calculate summary values for subgroups, and you can calculate more than one aggregate for the same group.FORMAT="LINESPECIFIC"Start of MOREINFO="NONE"select statement compute row_aggregate (column_name)      [, row_aggregate(column_name)]... [by column_name [, column_name]...]continue
Causes the MOREINFO="NONE"while loop to restart. MOREINFO="NONE"continue is often activated by an MOREINFO="NONE"if test.FORMAT="LINESPECIFIC"while boolean_expression     statement break     statement continuecreate database
Creates a new database. Use MOREINFO="NONE"create database from the master database. FORMAT="LINESPECIFIC"create database database_name [on {default | database_device} [= size]      [, database_device [= size]]...] [log on database_device [= size]     [, database_device [= size]]...][with override][for load]create default
Specifies a value to insert in a column (or in all columns of a user-defined datatype) if no value is explicitly supplied at insert time.FORMAT="LINESPECIFIC"create default [owner.]default_name as constant_expressioncreate index
Creates an index on one or more columns in a table. FORMAT="LINESPECIFIC"create [unique] [clustered | nonclustered]    index index_name on [[database.]owner.]table_name (column_name    [, column_name]...) [with {fillfactor = x, ignore_dup_key, sorted_data,    [ignore_dup_row | allow_dup_row]}] [on segment_name]create procedure
Creates a stored procedure that can take one or more user-supplied parameters.FORMAT="LINESPECIFIC"create procedure [owner.]procedure_name[;number][[(]@parameter_name     datatype [(length) | (precision [, scale])    [= default][output][, @parameter_name     datatype [(length) | (precision [, scale])    [= default][output]]...[)]][with recompile] as SQL_statementscreate rule
Specifies the domain of acceptable values for a particular column or for any column of a user-defined datatype.FORMAT="LINESPECIFIC"create rule [owner.]rule_name as condition_expressioncreate schema
Creates a new collection of tables, views and permissions for a database user.FORMAT="LINESPECIFIC"create schema authorization authorization_namecreate_oject_statement     [ create_object_statement ... ][ permission_statement ... ]create table
Creates new tables and optional integrity constraints. FORMAT="LINESPECIFIC" create table [database.[owner].]table_name (column_name) datatype    [default {constant_expression | user | null}]    {[{identity | null | not null}]    | [[constraint constraint_name]        {{unique | primary key}            [clustered | nonclustered]            [with fillfactor = x] [on segment_name]        | references [[database.]owner.]ref_table            [(ref_column)]        | check (search_condition)}]}... | [constraint constraint_name]    {{unique | primary key}         [clustered | nonclustered]        (column_name [{, column_name}...])        [with fillfactor = x] [on segment_name]    | foreign key (column_name [{, column_name}...])        references [[database.]owner.]ref_table           [(ref_column [{, ref_column}...])]    | check (search_condition)} [{, {next_column | next_constraint}}...]) [on segment_name]create trigger
Creates a trigger, a type of stored procedure often used for enforcing integrity constraints. A trigger executes automatically when a user attempts a specified data modification statement on a specified table. FORMAT="LINESPECIFIC"create trigger [owner.]trigger_name on [owner.]table_name {for {insert , update , delete} as SQL_statementsREMAP="BO--Body"Or, using theMOREINFO="NONE" if update clause:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"create trigger [owner.]trigger_name on [owner.]table_name for {insert , update} as     [if update (column_name)         [{and | or} update (column_name)]...]         SQL_statements    [if update (column_name)         [{and | or} update (column_name)]...         SQL_statements]...create view
Creates a view, which is an alternative way of looking at the data in one or more tables. FORMAT="LINESPECIFIC"create view [owner.]view_name [(column_name [, column_name]...)] as select [distinct] select_statement[with check option]dbcc
Database Consistency Checker (MOREINFO="NONE"dbcc) checks the logical and physical consistency of a database. MOREINFO="NONE"dbcc should be used regularly as a periodic check, or if damage is suspected. FORMAT="LINESPECIFIC"dbcc {checktable({table_name|table_id}[, skip_ncindex]) |  checkdb [(database_name [, skip_ncindex] )] |   checkalloc [(database_name [, fix | nofix])] | tablealloc ({table_name | table_id}    [, {full | optimized | fast | null}     [, fix | nofix ] ]] )| indexalloc ({table_name | table_id}, index_id    [, {full | optimized | fast | null}    [, fix | nofix ]] ) |  checkcatalog [(database_name)] |   dbrepair (database_name, dropdb) |    reindex ({table_name | table_id}) | fix_text ({table_name | table_id}) }deallocate cursor
Makes a cursor inaccessible and releases all memory resources committed to that cursor.FORMAT="LINESPECIFIC"deallocate cursor cursor_namedeclare
Declares the name and type of local variables for a batch or procedure. Local variables are assigned values with a MOREINFO="NONE"select statement.FORMAT="LINESPECIFIC"Variable declaration:FORMAT="LINESPECIFIC"declare @variable_name datatype [, @variable_name datatype]... FORMAT="LINESPECIFIC"Variable assignment:FORMAT="LINESPECIFIC"select @variable = {expression | select_statement} [, @variable = {expression | select_statement} ...][from table_list] [where search_conditions] [group by group_by_list] [having search_conditions] [order by order_by_list] [compute function_list [by by_list]]declare cursor
Defines a cursor.FORMAT="LINESPECIFIC"declare cursor_name cursorfor select_statement[for {read only | update [of column_name_list]}]delete
Removes rows from a table. FORMAT="LINESPECIFIC"delete [from] [[database.]owner.]{table_name|view_name}[where search_conditions]FORMAT="LINESPECIFIC"delete [[database.]owner.]{table_name | view_name} [from [[database.]owner.]{table_name | view_name}  [, [[database.]owner.]{table_name | view_name}]...] [where search_conditions]FORMAT="LINESPECIFIC"delete [from] [[database.]owner.]{table_name|view_name}where current of cursor_namedisk init
Makes a physical device or file usable by SQL Server. (The master device is initialized by the MOREINFO="NONE"sybinit installation program; it is not necessary to initialize this device with MOREINFO="NONE"disk init.) FORMAT="LINESPECIFIC"disk init name = "device_name" , physname = "physicalname" , vdevno = virtual_device_number , size = number_of_blocks [, vstart = virtual_address , cntrltype = controller_number ] [, contiguous] (OpenVMS only)disk mirror
Creates a software mirror that immediately takes over when the primary device fails. You can mirror the master device, devices that store data, and devices that store transaction logs; you cannot mirror dump devices.FORMAT="LINESPECIFIC"disk mirror name = "device_name" , mirror = "physicalname" [ ,writes = { serial | noserial }] [ ,contiguous ] (OpenVMS only)disk refit
Rebuilds the master database's sysusages and sysdatabases system tables from information contained in sysdevices. Use MOREINFO="NONE"disk refit after MOREINFO="NONE"disk reinit as part of the procedure to restore the master database.FORMAT="LINESPECIFIC"disk refitdisk reinit
Rebuilds the master database's sysdevices system table. Use MOREINFO="NONE"disk reinit as part of the procedure to restore the master database.FORMAT="LINESPECIFIC"disk reinit name = "device_name", physname = "physicalname" , vdevno = virtual_device_number , size = number_of_blocks [, vstart = virtual_address , cntrltype = controller_number]disk remirror
Restarts disk mirroring after it is stopped by failure of a mirrored device or temporarily disabled by the MOREINFO="NONE"disk unmirror command. FORMAT="LINESPECIFIC"disk remirror name = "device_name"disk unmirror
De-activates disk mirroring to allow hardware maintenance or the changing of a hardware device. MOREINFO="NONE"disk unmirror disables either the original database device or the mirror, so that it is no longer available to SQL Server for reads or writes. It does not remove the associated file from the operating system.FORMAT="LINESPECIFIC"disk unmirror name = "MOREINFO="NONE"device_name" [ ,side = { "primary" | secondary }] [ ,mode = { retain | remove }]drop database
Removes one or more databases from SQL Server.FORMAT="LINESPECIFIC"drop database database_name [, database_name]...drop default
Removes a user-defined default.FORMAT="LINESPECIFIC"drop default [owner.]default_name [, [owner.]default_name]...drop index
Removes an index from a table in the current database.FORMAT="LINESPECIFIC"drop index table_name.index_name [, table_name.index_name]...drop procedure
Removes user-defined stored procedures.FORMAT="LINESPECIFIC"drop procedure [owner.]procedure_name [, [owner.]procedure_name] ...drop rule
Removes a user-defined rule.FORMAT="LINESPECIFIC"drop rule [owner.]rule_name [, [owner.]rule_name]...drop table
Removes a table definition and all of its data, indexes, triggers, and permission specifications from the database.FORMAT="LINESPECIFIC"drop table [[database.]owner.]table_name [, [[database.]owner.]table_name ]...drop trigger
Removes a trigger. FORMAT="LINESPECIFIC"drop trigger [owner.]trigger_name [, [owner.]trigger_name]...drop view
Removes one or more views from the current database. FORMAT="LINESPECIFIC"drop view [owner.]view_name [, [owner.]view_name]...dump database
Makes a backup copy of the entire database, including the transaction log, in a form that can be read in with MOREINFO="NONE"load database. Dumps and loads are performed through a Backup Server.FORMAT="LINESPECIFIC"dump database database_name to stripe_device [ at backup_server_name ]     [density = density_value,     blocksize = number_bytes,     capacity = number_kilobytes,      dumpvolume = volume_name,     file = file_name][stripe on stripe_device [ at backup_server_name ]     [density = density_value,      blocksize = number_bytes,     capacity = number_kilobytes,      dumpvolume = volume_name,     file = file_name]][[stripe on stripe_device [ at backup_server_name ]      [density = density_value,      blocksize = number_bytes,     capacity = number_kilobytes,      dumpvolume = volume_name,     file = file_name]]...][with {     density = density_value,      blocksize = number_bytes,     capacity = number_kilobytes,      dumpvolume = volume_name,     file = file_name,    [dismount | nodismount],    [nounload | unload],    retaindays = number_days,    [noinit | init],    notify = {client | operator_console}    }]]dump transaction
Makes a copy of a transaction log and removes the inactive portion.MOREINFO="NONE"  To make a routine log dump: FORMAT="LINESPECIFIC"dump tran[saction] database_name  to stripe_device [ at backup_server_name ]    [density = density_value,      blocksize = number_bytes,     capacity = number_kilobytes,      dumpvolume = volume_name,     file = file_name][stripe on stripe_device [ at backup_server_name ]    [density = density_value,      blocksize = number_bytes,     capacity = number_kilobytes,      dumpvolume = volume_name,     file = file_name]][[stripe on stripe_device [ at backup_server_name ]     [density = density_value,      blocksize = number_bytes,     capacity = number_kilobytes,      dumpvolume = volume_name,     file = file_name] ]...][with {     density = density_value,     blocksize = number_bytes,    capacity = number_kilobytes,     dumpvolume = volume_name,    file = file_name,    [dismount | nodismount],    [nounload | unload],    retaindays = number_days,    [noinit | init],    notify = {client | operator_console}}]To truncate the log without making a backup copy:FORMAT="LINESPECIFIC"dump tran[saction] database_name  with truncate_onlyTo truncate a log that is filled to capacity. Use only as a last resort:FORMAT="LINESPECIFIC"dump tran[saction] database_name  with no_logTo back up the log after a database device fails:FORMAT="LINESPECIFIC"dump tran[saction] database_name  to stripe_device [ at backup_server_name ]    [density = density_value,      blocksize = number_bytes,     capacity = number_kilobytes,      dumpvolume = volume_name,     file = file_name][stripe on stripe_device [ at backup_server_name ]    [density = density_value,      blocksize = number_bytes,     capacity = number_kilobytes,      dumpvolume = volume_name,     file = file_name]][[stripe on stripe_device [ at backup_server_name ]     [density = density_value,      blocksize = number_bytes,     capacity = number_kilobytes,      dumpvolume = volume_name,     file = file_name] ]...][with {     density = density_value,     blocksize = number_bytes,    capacity = number_kilobytes,     dumpvolume = volume_name,    file = file_name,    [dismount | nodismount],    [nounload | unload],    retaindays = number_days,    [noinit | init],    no_truncate,     notify = {client | operator_console}}]execute
Runs a system procedure or a user-defined stored procedure. FORMAT="LINESPECIFIC"[execute] [@return_status = ][[[server.]database.]owner.]procedure_name[;number]     [[@parameter_name =] value |         [@parameter_name =] @variable [output]    [,[@parameter_name =] value |         [@parameter_name =] @variable [output]...]] [with recompile]fetch
Returns a row or a set of rows from a cursor result set.FORMAT="LINESPECIFIC"fetch cursor_name [ into fetch_target_list ]goto Label
Branches to a user-defined label.FORMAT="LINESPECIFIC"label: goto labelgrant
Assigns permissions to users. To grant permission to access database objects:FORMAT="LINESPECIFIC"grant {all [privileges]| permission_list} on { table_name [(column_list)]    | view_name[(column_list)]     | stored_procedure_name}to {public | name_list | role_name}[with grant option]To grant permission to create database objects:FORMAT="LINESPECIFIC"grant {all [privileges] | command_list} to {public | name_list | role_name}group by and having Clauses
Used in MOREINFO="NONE"select statements to divide a table into groups. REMAP="BO--Body"Start of MOREINFO="NONE"select statementREMAP="SY--Syntax" FORMAT="LINESPECIFIC"group by [all] aggregate_free_expression     [, aggregate_free_expression]...[having search_conditions]REMAP="BO--Body"End of MOREINFO="NONE"select statementif...else
Imposes conditions on the execution of a SQL statement. The statement following an MOREINFO="NONE"if keyword and its condition is executed if the condition is satisfied (when the logical expression returns "true"). The optional MOREINFO="NONE"else keyword introduces an alternate SQL statement that executes when the MOREINFO="NONE"if condition is not satisfied (when the logical expression returns "false"). FORMAT="LINESPECIFIC"if logical_expressionstatementsFORMAT="LINESPECIFIC"[else [if logical_expression] statement]insert
Adds new rows to a table or view.FORMAT="LINESPECIFIC"insert [into] [database.[owner.]]{table_name|view_name}[(column_list)] {values (expression [, expression]...)    |select_statement }kill
Kills a process. FORMAT="LINESPECIFIC"kill spidload database
Loads a backup copy of a user database, including its transaction log, that was created with MOREINFO="NONE"dump database. The MOREINFO="NONE"listonly and MOREINFO="NONE"headeronly options display information about the dump files without loading them. Dumps and loads are performed through a Backup Server.FORMAT="LINESPECIFIC"load database database_name from stripe_device [at backup_server_name ]    [density = density_value,      blocksize = number_bytes,     dumpvolume = volume_name,      file = file_name][stripe on stripe_device [at backup_server_name ]    [density = density_value,      blocksize = number_bytes,     dumpvolume = volume_name,      file = file_name][stripe on stripe_device [at backup_server_name ]     [density = density_value,      blocksize = number_bytes,      dumpvolume = volume_name,     file = file_name]...][with {    density = density_value,     blocksize = number_bytes,    dumpvolume = volume_name,     file = file_name,    [dismount | nodismount],    [nounload | unload],    listonly [= full],    headeronly,     notify = {client | operator_console}    }]load transaction
Loads a backup copy of the transaction log that was created with the MOREINFO="NONE"dump transaction command. The MOREINFO="NONE"listonly and MOREINFO="NONE"headeronly options display information about the dump files without loading them. Dumps and loads are performed through a Backup Server.FORMAT="LINESPECIFIC"load tran[saction] database_namefrom stripe_device [at backup_server_name]    [density = density_value,      blocksize = number_bytes,      dumpvolume = volume_name,     file = file_name][stripe on stripe_device [at backup_server_name]    [density = density_value,      blocksize = number_bytes,     dumpvolume = volume_name,     file = file_name][stripe on stripe_device [at backup_server_name]     [density = density_value,      blocksize = number_bytes,      dumpvolume = volume_name,     file = file_name]...][with {     density = density_value,     blocksize = number_bytes,     dumpvolume = volume_name,    file = file_name,    [dismount | nodismount],    [nounload | unload],    listonly [= full],    headeronly,    notify = {client | operator_console}}]open
Opens a cursor for processing.FORMAT="LINESPECIFIC"open cursor_nameorder by Clause
Returns query results in the specified column(s) in sorted order.FORMAT="LINESPECIFIC"[order by {[table_name.| view_name.]column_name    | select_list_number | expression} [asc | desc][,{[table_name.| view_name.] column_name     select_list_number|expression} [asc |desc]]...]prepare transaction
Used by DB-Library in a two-phase commit application to see if a server is prepared to commit a transaction.FORMAT="LINESPECIFIC"prepare transactionprint
Prints a user-defined message on the user's screen. FORMAT="LINESPECIFIC"print {format_string | @local_variable | @@global_variable}    [, arg_list]raiserror
Prints a user-defined error message on the user's screen and sets a system flag to record that an error condition has occurred. FORMAT="LINESPECIFIC"raiserror error_number [{format_string | @local_variable}] [, arg_list][extended_value = extended_value [{, extended_value = extended_value}...]]readtext
Reads text and image values, starting from a specified offset and reading a specified number of bytes or characters.FORMAT="LINESPECIFIC"readtext [[database.]owner.]table_name.column_nametext_pointer offset size [holdlock][using {bytes | chars | characters}]reconfigure
Sets configuration variables that control various aspects of SQL Server's memory allocation, performance, and options. Used with the system procedure MOREINFO="NONE"sp_configure. FORMAT="LINESPECIFIC"reconfigure [with override]return
Exits from a batch or procedure unconditionally, optionally providing a return status. Statements following MOREINFO="NONE"return are not executed. FORMAT="LINESPECIFIC"return [integer_expression]revoke
Revokes permissions from users. FORMAT="LINESPECIFIC"revoke [grant option for] {all [privileges] | permission_list} on { table_name [(column_list)]     | view_name [(column_list)]     | stored_procedure_name}from {public | name_list | role_name}[cascade]FORMAT="LINESPECIFIC"revoke {all [privileges] | command_list} from {public | name_list | role_name}rollback
Rolls a user-defined transaction back to the last savepoint inside the transaction or to the beginning of the transaction. FORMAT="LINESPECIFIC"rollback {transaction | tran | work}[transaction_name | savepoint_name]rollback trigger
Rolls back the work done in a trigger, including the data modification that caused the trigger to fire, and issues an optional MOREINFO="NONE"raiserror statement.FORMAT="LINESPECIFIC"rollback trigger[with raiserror_statement]save transaction
Sets a savepoint within a transaction.FORMAT="LINESPECIFIC"save transaction savepoint_nameselect
Retrieves rows from database objects. FORMAT="LINESPECIFIC"select [all | distinct] select_list [into [[database.]owner.]table_name] [from [[database.]owner.]{table_name |view_name}        [holdlock | noholdlock] [shared]    [,[[database.]owner.]{table_name |view_name}         [holdlock | noholdlock] [shared]]... ]  [where search_conditions]  [group by [all] aggregate_free_expression    [, aggregate_free_expression]... ][having search_conditions] [order by {[[[database.]owner.]{table_name.|view_name.}]    column_name | select_list_number | expression}        [asc | desc][,{[[[database.]owner.]{table_name|view_name.}]    column_name | select_list_number | expression}         [asc | desc]]...] [compute row_aggregate(column_name)        [, row_aggregate(column_name)]...    [by column_name [, column_name]...]]  [for {read only | update [of column_name_list]}] [for browse]set
Sets SQL Server query-processing options for the duration of the user's work session. Can be used to set some options inside a trigger or stored procedure.FORMAT="LINESPECIFIC"set ansinull {on | off}FORMAT="LINESPECIFIC"set ansi_permissions {on | off}FORMAT="LINESPECIFIC"set arithabort [arith_overflow | numeric_truncation]{on | off}FORMAT="LINESPECIFIC"set arithignore [arith_overflow] {on | off}FORMAT="LINESPECIFIC"set {chained, close on endtran, nocount, noexec, parseonly, procid, self_recursion, showplan}{on | off}FORMAT="LINESPECIFIC"set char_convert {off | on [with {error | no_error}] |charset [with {error | no_error}]}FORMAT="LINESPECIFIC"set cursor rows number for cursor_nameFORMAT="LINESPECIFIC"set {datefirst number, dateformat format,language language}FORMAT="LINESPECIFIC"set dup_in_subquery {on | off}FORMAT="LINESPECIFIC"set fipsflagger {on | off}FORMAT="LINESPECIFIC"set flushmessage {on | off}FORMAT="LINESPECIFIC"set identity_insert [database.[owner.]]table_name{on | off}FORMAT="LINESPECIFIC"set offsets {select, from, order, compute, table,procedure, statement, param, execute} {on | off}FORMAT="LINESPECIFIC"set quoted_identifier {on | off}FORMAT="LINESPECIFIC"set role {"sa_role" | "sso_role" | "oper_role"} {on | off}FORMAT="LINESPECIFIC"set {rowcount number, textsize number}FORMAT="LINESPECIFIC"set statistics {io, time} {on | off}FORMAT="LINESPECIFIC"set string_rtruncation {on | off}FORMAT="LINESPECIFIC"set textsize {number}FORMAT="LINESPECIFIC"set transaction isolation level {1 | 3}setuser
Allows a Database Owner to impersonate another user. FORMAT="LINESPECIFIC"setuser ["user_name"]shutdown
Shuts down the SQL Server from which the command is issued, its local Backup Server, or a remote Backup Server. This command can only be issued by a System Administrator.FORMAT="LINESPECIFIC"shutdown [srvname] [with {wait | nowait}]truncate table
Removes all rows from a table.FORMAT="LINESPECIFIC"truncate table [[database.]owner.]table_nameunion Operator
Returns a single result set that combines the results of two or more queries. Duplicate rows are eliminated from the result set unless theMOREINFO="NONE" all keyword is specified.FORMAT="LINESPECIFIC"       select select_list [into clause]         [from clause] [where clause]         [group by clause] [having clause] [union [all]      select select_list         [from clause] [where clause]         [group by clause] [having clause] ]... [order by clause] [compute clause]update
Changes data in existing rows, either by adding data or by modifying existing data.FORMAT="LINESPECIFIC"update [[database.]owner.]{table_name | view_name} set [[[database.]owner.]{table_name.|view_name.}]    column_name1 =        {expression1|NULL|(select_statement)}    [, column_name2 =         {expression2|NULL|(select_statement)}]...[from [[database.]owner.]{table_name | view_name}     [,[[database.]owner.]{table_name|view_name}]...][where search_conditions]FORMAT="LINESPECIFIC"update [[database.]owner.]{table_name | view_name} set [[[database.]owner.]{table_name.|view_name.}]    column_name1 =        {expression1|NULL|(select_statement)}    [, column_name2 =         {expression2|NULL|(select_statement)}]...where current of cursor_nameupdate statistics
Updates information about the distribution of key values in specified indexes. FORMAT="LINESPECIFIC"update statistics table_name [index_name]use
Specifies the database with which you want to work. FORMAT="LINESPECIFIC"use database_namewaitfor
Specifies a specific time, a time interval, or an event for the execution of a statement block, stored procedure, or transaction. FORMAT="LINESPECIFIC"waitfor { delay time | time time | errorexit | processexit | mirrorexit }where Clause
Sets the search conditions in a MOREINFO="NONE"select, MOREINFO="NONE"insert, MOREINFO="NONE"update, or MOREINFO="NONE"delete statement. (Joins and subqueries are specified in the search conditions: see the LINKEND="X87444""Joins"
 and LINKEND="X88542""Subqueries"
 sections for full details.)FORMAT="LINESPECIFIC"where [not] expression comparison_operator expressionFORMAT="LINESPECIFIC"where [not] expression [not] like  "match_string"[escape "escape_character"]FORMAT="LINESPECIFIC"where [not] expression is [not] nullFORMAT="LINESPECIFIC"where [not] expression [not] between expression and expressionFORMAT="LINESPECIFIC"where [not]expression [not] in ({value_list | subquery})FORMAT="LINESPECIFIC"where [not] exists (subquery)FORMAT="LINESPECIFIC"where [not] expression comparison_operator {any|all} (subquery)FORMAT="LINESPECIFIC"where [not] column_name join_operator column_nameFORMAT="LINESPECIFIC"where [not] boolean_expressionFORMAT="LINESPECIFIC"where [not] expression {and | or} [not] expressionwhile
Sets a condition for the repeated execution of a statement or statement block. The statement(s) are executed repeatedly as long as the specified condition is true.FORMAT="LINESPECIFIC"while logical_expression     statementwritetext
Permits non-logged, interactive updating of an existing text or image column. FORMAT="LINESPECIFIC"writetext [[database.]owner.]table_name.column_nametext_pointer [with log] dataNUMBER="2"Transact-SQL FunctionsRENDERAS="SECT1"Aggregate Functions  REMAP="BO--Body"The aggregate functions generate summary values that appear as new columns in the query results. They can be used in the select list or the MOREINFO="NONE"having clause of a MOREINFO="NONE"select statement or subquery, and often appear in a statement that includes a MOREINFO="NONE"group by clause.COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="153*"COLNAME="C2" COLWIDTH="347*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Aggregate FunctionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Result VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"sum([all | distinct] expression) COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Total of (distinct) values in the numeric 
column COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"avg([all | distinct] expression) COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Average of (distinct) values in the 
numeric column COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"count([all | distinct] expression) COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Number of (distinct) non-null values in 
the column COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"count(*) COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Number of selected rows COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"max(expression) COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Highest value in the expression COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"min(expression) COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Lowest value in the expression RENDERAS="SECT1"Datatype Conversion FunctionsREMAP="BO--Body"Datatype conversion functions change expressions from one datatype to another and specify new display formats for date/time information. SQL Server provides three datatype conversion functions, MOREINFO="NONE"convert(), MOREINFO="NONE"inttohex(), and MOREINFO="NONE"hextoint(), which can be used in the select list, in the MOREINFO="NONE"where clause, and anywhere else an expression is allowed.COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="100*"COLNAME="C2" COLWIDTH="160*"COLNAME="C3" COLWIDTH="200*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FunctionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ArgumentCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ResultVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"convert COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(datatype [(length) | (precision[, scale])], 
expression[, style])COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Converts between a wide variety 
of datatypes and reformats 
date/time and money data for 
display purposes.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"hextoint COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(hexadecimal_string)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the platform-
independent integer equivalent 
of a hexadecimal string.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"inttohex COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(integer_expression)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the platform-
independent hexadecimal 
equivalent of an integer.RENDERAS="SECT1"Date FunctionsREMAP="BO--Body"Manipulate datetime values.COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="72*"COLNAME="C2" COLWIDTH="189*"COLNAME="C3" COLWIDTH="333*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FunctionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ArgumentCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Result VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"getdate COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"()COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the current system 
date and time.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"datename COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(datepart, date)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the name of the 
specified part (such as the 
month "June") of a datetime 
value, as a character string. 
If the result is numeric, such 
as "23" for the day, it is still 
returned as a character string.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"datepart COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(datepart, date)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns an integer value for 
the specified part of a datetime 
value. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"datediff COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(datepart, date1, date2)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns date2 - date1, 
measured in the specified 
date part. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"dateadd COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(datepart, 
numeric_expression, 
date)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the date produced by 
adding the specified number 
of the specified date parts to 
the date. numeric_expression can be any numeric type; the 
value is truncated to an 
integer. RENDERAS="SECT1"Mathematical FunctionsREMAP="BO--Body"Mathematical functions return values commonly needed for operations on mathematical data. Mathematical function names are not keywords.:COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="90*"COLNAME="C2" COLWIDTH="156*"COLNAME="C3" COLWIDTH="365*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FunctionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ArgumentCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Result VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"abs COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the absolute value of a given 
expression. Results are of the same type and 
have the same precision and scale as the 
numeric expression. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"acos COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the angle (in radians) whose cosine 
is the specified value. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"asin COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the angle (in radians) whose sine is 
the specified value. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"atan COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the angle (in radians) whose tangent 
is the specified value. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"atn2 COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric1,
 approx_numeric2)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the angle (in radians) whose tangent 
is (approx_numeric1/approx_numeric2).COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"ceiling COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the smallest integer greater than or 
equal to the specified value. Results are of 
the same type as the numeric expression. For 
numeric and decimal expressions, the 
results have a precision equal to that of the 
expression and a scale of 0.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"cos COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the cosine of the specified angle (in 
radians). COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"cot COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the cotangent of the specified angle 
(in radians). COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"degrees COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Converts radians to degrees. Results are of 
the same type as the numeric expression. For 
numeric and decimal expressions, the results 
have an internal precision of 77 and a scale 
equal to that of the expression. When money 
datatypes are used, internal conversion to 
float may cause loss of precision. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"exp COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the exponential value of the 
specified value. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"floor COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the largest integer less than or equal 
to the specified value. Results are of the 
same type as the numeric expression. For 
numeric and decimal expressions, the results 
have a precision equal to that of the 
expression and a scale of 0.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"log COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the natural logarithm of the 
specified value. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"log10 COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the base 10 logarithm of the 
specified value. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"pi COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"()COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the constant value of 
3.1415926535897936. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"power COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(numeric, power) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the value of numeric raised to the 
power power. Results are of the same type 
as numeric. For expressions of type 
numeric or decimal, the results have an 
internal precision of 77 and a scale equal to 
that of the expression. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"radians COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Converts degrees to radians. Results are of 
the same type as numeric. For expressions of 
type numeric or decimal, the results have 
an internal precision of 77 and a scale equal 
to that of the numeric expression. When 
money datatypes are used, internal 
conversion to float may cause loss of 
precision. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"rand COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"([integer])COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns a random float value between 0 
and 1, using the optional integer as a seed 
value. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"round COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(numeric, integer)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Rounds the numeric so that it has integer significant digits. A positive integer 
determines the number of significant digits 
to the right of the decimal point; a negative 
integer, the number of significant digits to 
the left of the decimal point. Results are of 
the same type as the numeric expression 
and, for numeric and decimal expressions, 
have an internal precision of 77 and scale 
equal to that of the numeric expression.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"sign COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the positive (+1), zero (0), or 
negative (-1). Results are of the same type, 
and have the same precision and scale, as the 
numeric expression. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"sin COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the sine of the specified angle 
(measured in radians). COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"sqrt COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the square root of the specified 
value. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"tan COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the tangent of the specified angle 
(measured in radians). RENDERAS="SECT1"Row Aggregate FunctionsREMAP="BO--Body"Generate summary values that appear as additional rows in the query results.REMAP="SY--Syntax" FORMAT="LINESPECIFIC"Start of select statementREMAP="SY--Syntax" FORMAT="LINESPECIFIC"compute row_aggregate(column_name)     [, row_aggregate(column_name)]... [by column_name [, column_name]...]REMAP="SY--Syntax" FORMAT="LINESPECIFIC"COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="45*"COLNAME="C2" COLWIDTH="261*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Meaning VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"sum COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Total of values in the (numeric) column COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"avg COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Average of values in the (numeric) column COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"min COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Lowest value in the column COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"max COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Highest value in the column COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"count COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Number of non-null values in the column RENDERAS="SECT1"String FunctionsID="IN1841"Pattern matchingPattern matching:!see alsoSee also patindex, String functions, Wildcard charactersREMAP="BO--Body"Operate on binary data, character strings, and expressions. ID="IN572"ConstantsConstants:string functionsin string functions
String functions can be nested, and they can be used anywhere an expression is allowed. When you use constants with a string function, enclose them in single or double quotes. String function names are not keywords. COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="63*"COLNAME="C2" COLWIDTH="163*"COLNAME="C3" COLWIDTH="361*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"FunctionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"ArgumentCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"ResultVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"ascii COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the ASCII code for the first 
character in the expression.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"char COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(integer_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Converts a single-byte integer value to a 
character value. (MOREINFO="NONE"char is usually used as the 
inverse of MOREINFO="NONE"ascii.) integer_expr must be 
between 0 and 255. Returns a char 
datatype. If the resulting value is the first 
byte of a multibyte character, the 
character may be undefined.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"charindex COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(expression1,expression2) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Searches expression2 for the first 
occurrence of expression1 and returns an 
integer representing its starting position. 
If expression1 is not found, returns 0. If 
expression1 contains wildcard characters, 
MOREINFO="NONE"charindex treats them as literals.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"char_length COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns an integer representing the 
number of characters in a character 
expression or text value. For variable-
length data, MOREINFO="NONE"char_length strips the 
expression of trailing blanks before 
counting the number of characters. For 
multi-byte character sets, the number of 
characters in the expression is usually less 
than the number of bytes; use MOREINFO="NONE"datalength 
(See LINKEND="X52175""System Functions") to determine 
the number of bytes.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"difference COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr1,char_expr2) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns an integer representing the 
difference between two MOREINFO="NONE"soundex values. 
See MOREINFO="NONE"soundex, below.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"lower COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Converts upper to lower case, returning a 
character value.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"ltrim COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Removes leading blanks from the 
character expression. Only values 
equivalent to the space character in the 
current character set are removed. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"patindex COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"("%pattern%",char_expr [,MOREINFO="NONE" using{MOREINFO="NONE"bytes | MOREINFO="NONE"chars |MOREINFO="NONE"characters} ] ) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns an integer representing the 
starting position of the first occurrence of pattern in the specified character 
expression, or a zero if pattern is not 
found. By default, MOREINFO="NONE"patindex returns the 
offset in characters; to return the offset in 
bytes (multibyte character strings), 
specify MOREINFO="NONE"using bytes. The `%' wildcard 
character must precede and follow pattern 
(except when searching for first or last 
characters). See LINKEND="X39597""Wildcard Characters" for 
a description of the wildcard characters 
that can be used in pattern. Can be used 
on text data.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"replicate COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr,integer_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns a string with the same datatype 
as char_expr, containing the same 
expression repeated the specified number 
of times or as many times as will fit into a 
255 byte space, whichever is less.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"reverse COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the reverse of char_expr; if 
char_expr is "abcd", it returns "dcba".COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"right COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr,integer_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the part of the character 
expression starting the specified number 
of characters from the right. Return value 
has the same datatype as the character 
expression.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"rtrim COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Removes trailing blanks. Only values 
equivalent to the space character in the 
current character set are removed.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"soundex COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns a four-character MOREINFO="NONE"soundex code for 
character strings that are composed of a 
contiguous sequence of valid single- or 
double-byte roman letters.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"space COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(integer_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns a string with the indicated 
number of single-byte spaces.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"str COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(approx_numeric[, length [, decimal] ])COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns a character representation of the 
floating point number. length sets the 
number of characters to be returned 
(including the decimal point, all digits to 
the right and left of the decimal point, and 
blanks); decimal sets the number of 
decimal digits to be returned.length and decimal are optional. If given, 
they must be non-negative. Default length 
is 10; default decimal is 0. MOREINFO="NONE"str() rounds the 
decimal portion of the number so that the 
results fit within the specified length.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"stuff COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr1, start,length, char_expr2)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Deletes length characters from char_expr1 
at start, then inserts char_expr2 into 
char_expr1 at start. To delete characters 
without inserting other characters, 
char_expr2 should be NULL (not "", which 
indicates a single space). COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"substring COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(expression, start,length)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns part of a character or binary 
string. start specifies the character 
position at which the substring begins. 
length specifies the number of characters 
in the substring.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"upper COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(char_expr) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Converts lower to upper case, returning a 
character value.ID="X52175" RENDERAS="SECT1"System FunctionsREMAP="BO--Body"Return special information from the database.COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="93*"COLNAME="C2" COLWIDTH="206*"COLNAME="C3" COLWIDTH="360*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"FunctionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ArgumentCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Result VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"col_name COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(object_idMOREINFO="NONE"MOREINFO="NONE", column_id[, database_id])COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the column name. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"col_length COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(object_nameMOREINFO="NONE"MOREINFO="NONE", 
column_name)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the defined length of 
column. UseMOREINFO="NONE" datalength to see 
the actual data size.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"curunreservedpgs COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(database_id, 
page_number,  
free_pages)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the number of free 
pages in the disk piece that 
contains page_number. Use 
free_pages to specify a default 
value to be returned by the 
function. If the database is open, 
MOREINFO="NONE"curunreservedpgs replaces this 
value with the actual number of 
free pages stored in memory for 
that disk piece. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"data_pgs COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(object_idMOREINFO="NONE"MOREINFO="NONE", {doampgMOREINFO="NONE"MOREINFO="NONE" | 
ioampgMOREINFO="NONE"MOREINFO="NONE"})COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the number of pages 
used by table (doampg) or index 
(ioampg). The result does not 
include pages used for internal 
structures.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"datalength COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(expression)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the length of expression 
in bytes. expression is usually a 
column name. If expression is a 
character constant, it must be 
enclosed in quotes.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"db_id COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"([database_name]) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the database ID 
number. database_name must be 
a character expression; if it is a 
constant expression, it must be 
enclosed in quotes. If no 
database_name is supplied, MOREINFO="NONE"db_id 
returns the ID number of the 
current database.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"db_name COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"([database_id])COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the database name. 
database_id must be a numeric 
expression. If no database_id is 
supplied, MOREINFO="NONE"db_name returns the 
name of the current database.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"host_id COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"( )COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the host process ID of 
the client process (not the Server 
process).COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"host_name COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"( )COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the current host 
computer name of the client 
process (not the Server process).COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"index_col COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(object_nameMOREINFO="NONE"MOREINFO="NONE", index_idMOREINFO="NONE"MOREINFO="NONE", 
key_MOREINFO="NONE"MOREINFO="NONE"# [, user_id])COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the name of the indexed 
column; returns NULL if 
object_name is not a table or view 
name. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"isnull COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(expression1, 
expression2)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Substitutes the value specified 
in expression2 when expression1 evaluates to NULL.The 
datatypes of the expressions 
must convert implicitly, or you 
must use the MOREINFO="NONE"convert function.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"lct_admin COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"({{ "MOREINFO="NONE"lastchance" | 
"MOREINFO="NONE"logfull" | 
"MOREINFO="NONE"unsuspend"} , 
database_id} | 
"MOREINFO="NONE"reserve", log_pages})COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Manages the log segment's last-
chance threshold.
MOREINFO="NONE"lastchance creates a last-chance 
threshold in the specified 
database.
 MOREINFO="NONE"logfull returns 1 if the last-
chance threshold has been 
crossed in the specified 
database and 0 if it has not.MOREINFO="NONE" 
unsuspend awakens suspended 
tasks in the database and 
disables the last-chance 
threshold if that threshold has 
been crossed.
MOREINFO="NONE"reserve returns the number of 
free log pages required to 
successfully dump a 
transaction log of the specified 
size.   COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"object_id COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(object_name) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the object ID. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"object_name COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(object_id[, database_id])COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the object name.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"proc_role COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(MOREINFO="NONE""sa_role" |MOREINFO="NONE" "sso_role" 
| MOREINFO="NONE""oper_role")COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Checks to see if the invoking 
user possesses the correct role to 
execute the procedure. Returns 
1 if the invoker has the required 
role. Otherwise, returns 0.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"reserved_pgs COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"(object_idMOREINFO="NONE"MOREINFO="NONE", 
{doampg|ioampg})COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the number of pages 
allocated to table or index. This 
function does report pages used 
for internal structures.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"rowcnt COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(doampg)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the number of rows in a 
table (estimate). COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"show_role COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"( )COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the user's current active 
roles, if any (MOREINFO="NONE"sa_role, MOREINFO="NONE"sso_role,MOREINFO="NONE" or MOREINFO="NONE"oper_role). If the user has no 
roles, returns NULL.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"suser_id COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"([server_user_name])COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the server user's ID 
number from syslogins. If no 
server_user_name is supplied, it 
returns the server ID of the 
current user.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"suser_name COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"([server_user_id])COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the server user's name. 
Server user's ID's are stored in 
syslogins. If no server_user_id is 
supplied, it returns the name of 
the current user.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"used_pgs COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"(object_idMOREINFO="NONE"MOREINFO="NONE", doampgMOREINFO="NONE"MOREINFO="NONE", 
ioampg)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the total number of 
pages used by a table and its 
clustered index. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"tsequal COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(timestamp, timestamp2) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Compares timestamp values to 
prevent update on a row that 
has been modified since it was 
selected for browsing. 
timestamp is the timestamp of 
the browsed row; timestamp2 is 
the timestamp of the stored row. 
Allows you to use browse mode 
without calling DB-Library. 
(See "Browse Mode.")COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"user COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the user's name.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"user_id COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"([user_name]) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the user's ID number. 
Reports the number from 
sysusers in the current database. 
If no user_name is supplied, it 
returns the ID of the current 
user.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"user_name COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"([user_id]) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the user's name, based 
on the user's ID in the current 
database. If no user_id is 
supplied, it returns the name of 
the current user.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"valid_name COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(character_expression) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns 0 if string is not a valid 
identifier (illegal characters or 
string is more than 30 bytes 
long), a nonzero number if 
MOREINFO="NONE"string is a valid identifier. RENDERAS="SECT1"text and image FunctionsREMAP="BO--Body"Operate on text  and image data. Text and image built-in function names are not keywords. Use the MOREINFO="NONE"set textsize option to limit the amount of text or image data that a MOREINFO="NONE"select statement retrieves.COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="72*"COLNAME="C2" COLWIDTH="198*"COLNAME="C3" COLWIDTH="423*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FunctionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ArgumentCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ResultVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"patindex COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"("%pattern%",char_expr 
 [, MOREINFO="NONE"using {MOREINFO="NONE"bytes |MOREINFO="NONE" chars | 
MOREINFO="NONE"characters} ] )COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns an integer value representing the 
starting position of the first occurrence of pattern in the specified character expression, or zero if 
pattern is not found. By default, MOREINFO="NONE"patindex returns 
the offset in characters; to return the offset in 
bytes for multibyte character strings, specify 
MOREINFO="NONE"using bytes. The % wildcard character must 
precede and follow pattern, except when 
searching for first or last characters. See 
LINKEND="X39597""Wildcard Characters" for a description of the 
wildcard characters that can be used in pattern.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"patindex COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(text_columname) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns the text pointer value, a 16-byte binary 
value. The text pointer is checked to ensure that 
it points to the first text page.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"patindex COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"("table_name.col_name", 
textpointer)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Checks if a given text pointer is valid. Note that 
the identifier for a text or image column 
must include the table name. 
Returns 1 if the pointer is valid, or 0  if the 
pointer is invalid. NUMBER="3"Transact-SQL TopicsRENDERAS="SECT1"CommentsREMAP="BO--Body"Attach explanatory text to SQL statements, statement blocks, and system procedures. Comments are not executed.REMAP="BO--Body"A comment can be inserted on a line by itself or at the end of a command line. Two comment styles are available: the "slash-asterisk" style:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"/* text of comment (slash-asterisk style) */REMAP="BO--Body"and the "double-hyphen" style:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"-- text of comment (double-hyphen style)RENDERAS="SECT1"CursorsREMAP="BO--Body"A cursor provides access to the set of rows returned by a SQL query. A cursor is a symbolic name that is associated with a MOREINFO="NONE"select statement. Cursors enable you to access individual rows of data returned by SQL Server. Cursors consist of two parts: the cursor result set and the cursor position.REMAP="BO--Body"To create a cursor, use the MOREINFO="NONE"declare cursor statement:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"declare cursor_name cursorfor select_statement[for {read only | update [of column_name_list]}]REMAP="BO--Body"To open the cursor:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"open cursor_nameREMAP="BO--Body"After opening the cursor, you can fetch a row:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"fetch cursor_name [into fetch_target_list]REMAP="BO--Body"When you are finished with the result set of a cursor, you can MOREINFO="NONE"close it:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"close cursor_nameREMAP="BO--Body"If you want to discard the cursor, you must MOREINFO="NONE"deallocate it:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"deallocate cursor cursor_nameRENDERAS="SECT1"DatatypesREMAP="BO--Body"Specify the type of information, size, and storage format of columns, stored procedure parameters, and local variables.REMAP="BO--Body"COLS="4" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="190*"COLNAME="C2" COLWIDTH="190*"COLNAME="C3" COLWIDTH="350*"COLNAME="C4" COLWIDTH="190*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Datatypes by 
CategoryCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SynonymsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"RangeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Bytes of StorageVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" NAMEST="C1" NAMEEND="C2" ROTATE="0" MOREROWS="0"MOREINFO="NONE"Exact numeric: integers  COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"tinyint smallint int COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0" integer COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0 to 255215 -1 (32,767) to -215 (-32,768)231 (2,147,483,647) to -231 (-2,147,483,648)COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"124COLNAME="C1" ALIGN="LEFT" NAMEST="C1" NAMEEND="C2" ROTATE="0" MOREROWS="0"MOREINFO="NONE"Exact numeric: decimals COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"numeric (p, s)decimal (p, s)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"dec COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1038 -1 to -10381038 -1 to -1038COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"2 to 172 to 17COLNAME="C1" ALIGN="LEFT" NAMEST="C1" NAMEEND="C2" ROTATE="0" MOREROWS="0"MOREINFO="NONE"Approximate numeric COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"float (precision)double precision real COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"machine dependentmachine dependentmachine dependentCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4 or 884COLNAME="C1" ALIGN="LEFT" NAMEST="C1" NAMEEND="C2" ROTATE="0" MOREROWS="0"MOREINFO="NONE"Money COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"smallmoney money COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"214,748.3647 to -214,748.3648 922,337,203,685,477.5807 to-922,337,203,685,477.5808 COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"48COLNAME="C1" ALIGN="LEFT" NAMEST="C1" NAMEEND="C2" ROTATE="0" MOREROWS="0"MOREINFO="NONE"Date/time COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"smalldatetime datetime COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"January 1, 1900 to June 6, 2079January 1, 1753 to December 31,9999COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"48COLNAME="C1" ALIGN="LEFT" NAMEST="C1" NAMEEND="C2" ROTATE="0" MOREROWS="0"MOREINFO="NONE"Character COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"char(n)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"character COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"255 characters or lessCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"n COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"varchar(n)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"character varying, char varying COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"255 characters or lessCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"actual entry length COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"nchar(n)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"national character, national char COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"255 characters or lessCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"n * @@ncharsizeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"nvarchar(n) COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"nchar varying, national char varying, national character varying COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"255 characters or lessCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"n COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"textCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"231 -1 (2,147,483,647) bytes or lessCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0 or multiple of 2K (4K on Stratus)COLNAME="C1" ALIGN="LEFT" NAMEST="C1" NAMEEND="C2" ROTATE="0" MOREROWS="0"MOREINFO="NONE"Binary  COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"binary(n) varbinary(n) image COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"255 bytes or less 255 bytes or less 231 -1 (2,147,483,647) bytes or lessCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"n  actual entry length   0 or multiple of 2K (4K on Stratus)COLNAME="C1" ALIGN="LEFT" NAMEST="C1" NAMEEND="C2" ROTATE="0" MOREROWS="0"MOREINFO="NONE"Bit   COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bit COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0 or 1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1 (one byte holds up to 8 bit columns)COLNAME="C1" ALIGN="LEFT" NAMEST="C1" NAMEEND="C2" ROTATE="0" MOREROWS="0"MOREINFO="NONE"Sensitivity Label  COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sensitivity sensitivity_ boundary COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Data Low Data High Data Low Data HighCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4 4RENDERAS="SECT1"Disk MirroringREMAP="BO--Body"Creates a software mirror of a user database device, the master database device, or a database device used for user database transaction logs. If a database device fails, its mirror immediately takes over. RENDERAS="SECT1"ExpressionsREMAP="BO--Body"An expression is a combination of one or more constants, literals, functions, column identifiers and/or variables, separated by operators, that returns a single value. Expressions can be of several types, including arithmetic, relational, logical (or Boolean), and character string. In some Transact-SQL clauses, a subquery can be used in an expression. REMAP="SY--Syntax" FORMAT="LINESPECIFIC"expression comparison_operator [any | all] expressionREMAP="SY--Syntax" FORMAT="LINESPECIFIC"expression [not] in expressionREMAP="SY--Syntax" FORMAT="LINESPECIFIC"[not]exists expressionREMAP="SY--Syntax" FORMAT="LINESPECIFIC"expression [not] between expression and expressionREMAP="SY--Syntax" FORMAT="LINESPECIFIC"expression [not] like "match_string"[escape "escape_character"]REMAP="SY--Syntax" FORMAT="LINESPECIFIC"not expression like "match_string" [escape "escape_character"]REMAP="SY--Syntax" FORMAT="LINESPECIFIC"expression is [not] nullREMAP="SY--Syntax" FORMAT="LINESPECIFIC"not logical_expressionREMAP="SY--Syntax" FORMAT="LINESPECIFIC"logical_expression {and | or} logical_expressionREMAP="BO--Body"SQL Server uses the following arithmetic operators: COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="54*"COLNAME="C2" COLWIDTH="214*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SymbolCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Meaning VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"  +COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"addition COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"  -COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"subtraction COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"  *COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"multiplication COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"  /COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"division COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"  %COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"modulo (Transact-SQL extension) REMAP="BO--Body"SQL Server uses the following bitwise operators: COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="54*"COLNAME="C2" COLWIDTH="234*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SymbolCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Meaning VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"  &COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bitwise and (two operands) COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"  |COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bitwise or (two operands) COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"  ^COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bitwise exclusive or (two operands) COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"  ~COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bitwise not, unary not (one operand) REMAP="BO--Body"SQL Server uses the following comparison operators: COLS="4" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="63*"COLNAME="C2" COLWIDTH="127*"COLNAME="C3" COLWIDTH="191*"COLNAME="C4" COLWIDTH="255*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SymbolCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Meaning COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"=COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"equal toCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0">COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"greater thanCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"<COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"less thanCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0">=COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"greater than or equal toCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"<=COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"less than or equal to COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"<>COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"not equal to COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"!=COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"not equal to (Transact-SQL extension)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"!>COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"not greater than (Transact-SQL extension)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"!<COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"not less than (Transact-SQL extension) COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"RENDERAS="SECT1"IdentifiersREMAP="BO--Body"SQL Server identifiers can be a maximum of 30 bytes in length, whether single-byte or multibyte characters are used. The first character of an identifier must be either an alphabetic character as defined in the current character set or the underscore (_ ) symbol.REMAP="BO--Body"Subsequent characters can include letters, numbers, the symbols #, @, _, or currency symbols such as $ (dollars), name='yen' font='' code='165'  charset='fontspecific' (yen) and £ (pound sterling). Identifiers cannot include special characters such as !%^&*. or embedded spaces.RENDERAS="SECT1"IDENTITY ColumnsREMAP="BO--Body"IDENTITY columns contain system-generated values that uniquely identify each row within a table. They are used to store sequential numbers, such as invoice numbers or employee numbers, that are generated automatically by SQL Server. The value of the IDENTITY column uniquely identifies each row in a table.REMAP="BO--Body"Each table in a database can have a single IDENTITY column, of type numeric and scale zero. You can define an IDENTITY column when you create a table with a MOREINFO="NONE"create table or MOREINFO="NONE"select into statement, or add it later with an MOREINFO="NONE"alter table statement.REMAP="BO--Body"By definition, IDENTITY columns cannot be updated and do not allow nulls. Each time you insert a row into a table, SQL Server automatically supplies a unique, sequential value for its IDENTITY column, beginning with the value "1". Manual insertions, deletions, transaction rollbacks, and server failures can create gaps in IDENTITY column values.ID="X87444" RENDERAS="SECT1"JoinsREMAP="BO--Body"Joins compare two or more tables (or views) by specifying a column from each, comparing the values in those columns row by row, and concatenating rows that have matching values. Joins can also be stated as subqueries. (See LINKEND="X88542""Subqueries" for more information.)REMAP="BO--Body"A join can be embedded in a MOREINFO="NONE"select, MOREINFO="NONE"update, MOREINFO="NONE"insert, MOREINFO="NONE"delete, or subquery. Other search conditions and clauses may follow the join condition(s). Joins use the following syntax:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"Start of MOREINFO="NONE"select, update, insert, delete, or subquery from {table_list | view_list} where [not]      [table_name. | view_name.]column_name           join_operator      [table_name. | view_name.]column_name[{and | or} [not]     [table_name.|view_name.]column_name          join_operator      [table_name.|view_name.]column_name]...REMAP="SY--Syntax" FORMAT="LINESPECIFIC"End of MOREINFO="NONE" select, update, insert, delete, or subqueryRENDERAS="SECT1"Null ValuesREMAP="BO--Body"Marks columns having an unknown value (as opposed to those that have 0 or blank as a value). NULL allows you to distinguish between a deliberate entry of zero (for numerical columns) or blank (for character columns) and a non-entry (NULL for both numerical and character columns).REMAP="BO--Body"In MOREINFO="NONE"create table statements, declare each columns as MOREINFO="NONE"null, MOREINFO="NONE"not null, or MOREINFO="NONE"identity or accept the default null type for the database: REMAP="SY--Syntax" FORMAT="LINESPECIFIC"column_name datatype [null | not null | identity]REMAP="BO--Body"When adding a column to an existing table, you can specify it as MOREINFO="NONE"null or ID="IN701"alter table commandnull values and
MOREINFO="NONE"identity:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"column_name datatype [null | identity]ID="IN752"insert commandnull/not null columns andREMAP="BO--Body"You can explicitly insert NULL into a column: REMAP="SY--Syntax" FORMAT="LINESPECIFIC"values({expression | null}      [, {expression | null}]...)ID="IN653"update commandnull values andREMAP="BO--Body"Use the MOREINFO="NONE"update statement to set a column value to NULL. It's syntax is: REMAP="SY--Syntax" FORMAT="LINESPECIFIC"set column_name = {expression | null}     [, column_name = {expression | null}]...ID="IN1434"Null valuescreate procedure and create procedure command, null values andREMAP="BO--Body"In the MOREINFO="NONE"create procedure statement, you can declare NULL as the default value for individual parameters: REMAP="SY--Syntax" FORMAT="LINESPECIFIC"create procedure procedure_name      @param datatype [ = null ]     [, @param datatype [ = null ]]...ID="IN685"isnull system functionREMAP="BO--Body"Use the MOREINFO="NONE"isnull built-in function to substitute a particular value for nulls. The substitution is made only for display purposes; actual column values are not affected. The syntax is: REMAP="SY--Syntax" FORMAT="LINESPECIFIC"isnull(expression, value)RENDERAS="SECT1"ParametersREMAP="BO--Body"Parameters are arguments to a stored procedure. You define parameters when you create the procedure and supply their values when you execute the procedure. Not all procedures require parameters.REMAP="SY--Syntax" FORMAT="LINESPECIFIC"create procedure [owner.]procedure_name[;number][ [(] @parameter_name datatype [= default] [output]      [,@parameter_name datatype [= default] [output]]      ... [)] ][with recompile] as SQL_statementsREMAP="SY--Syntax" FORMAT="LINESPECIFIC"[execute] [@return_status = ][[server.]database.]owner.]procedure_name[;number][[@parameter_name =] value |      [@parameter_name =] @variable [output] [,[@parameter_name =] value |      [@parameter_name =] @variable [output]... ]] [with recompile]ID="X88542" RENDERAS="SECT1"SubqueriesREMAP="BO--Body"Used to "nest" a MOREINFO="NONE"select statement inside a MOREINFO="NONE"select, MOREINFO="NONE"insert, MOREINFO="NONE"update, or MOREINFO="NONE"delete statement, another subquery, or anywhere an expression is allowed (if it returns a single value). A subquery is always enclosed in parentheses.REMAP="SY--Syntax" FORMAT="LINESPECIFIC"(select [all | distinct] subquery_select_list [from [[database.]owner.]{table_name | view_name}     [holdlock] [, [[database.]owner.]{table_name | view_name}      [holdlock]]...] [where search_conditions] [group by aggregate_free_expression     [, aggregate_free_expression]...][having search_conditions])RENDERAS="SECT1"text and image DatatypesREMAP="BO--Body"text columns are variable-length columns that can hold up to 2,147,483,647 ( 231 - 1) bytes of printable characters. REMAP="BO--Body"image columns are variable-length columns that can hold up to 2,147,483,647 ( 231 - 1) bytes of hexadecimal-like data.REMAP="BO--Body"You define a text or image column as you would any other column, with a create table or alter table statement. text and image datatype definitions do not include lengths. They do permit null values. The column definition takes the form:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"column_name {text | image} [null]RENDERAS="SECT1"Variables (Local and Global)REMAP="BO--Body"Variables are defined entities that are assigned values. SQL Server has two kinds of variables:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"declare @variable_name datatype [, @variable_name datatype]...REMAP="SY--Syntax" FORMAT="LINESPECIFIC"select @variable_name = expression      [ , @variable_name = expression ]... [from clause] [where clause] [group by clause] [having clause] [order by clause] [compute clause]ID="X39597" RENDERAS="SECT1"Wildcard CharactersREMAP="BO--Body"Represent one or more characters, or a range of characters, in a match string.REMAP="BO--Body"Use wildcards in MOREINFO="NONE"where and MOREINFO="NONE"having clauses to find character or date/time information that is MOREINFO="NONE"like-or MOREINFO="NONE"not like-the match string:REMAP="SY--Syntax" FORMAT="LINESPECIFIC"{where | having} [not]expression [not] like match_string     [escape "escape_character"]NUMBER="4"System Proceduressp_addalias
Allows a SQL Server user to be known in a database as another user. FORMAT="LINESPECIFIC"sp_addalias login_name, name_in_dbsp_addauditrecord
Allows users to enter user-defined audit records (comments) into the audit trail.FORMAT="LINESPECIFIC"sp_addauditrecord [@text="message text"] [, @db_name="db_name"] [, @obj_name="object_name"][, @owner_name="object_owner"] [, @dbid=database_ID] [, @objid=object_ID]sp_addgroup
Adds a group to a database. Groups are used as collective names in granting and revoking privileges.FORMAT="LINESPECIFIC"sp_addgroup grpnamesp_addlanguage
Defines the names of the months and days for an alternate language and its date format.FORMAT="LINESPECIFIC"sp_addlanguage language, alias, months, shortmons, days, datefmt, datefirstsp_addlogin
Adds a new user account to SQL Server. FORMAT="LINESPECIFIC"sp_addlogin login_name, password [, defdb [, deflanguage [, fullname]]]sp_addmessage
Adds user-defined messages to sysusermessages for use by stored procedure MOREINFO="NONE"print and MOREINFO="NONE"raiserror calls and byMOREINFO="NONE" sp_bindmsg.FORMAT="LINESPECIFIC"sp_addmessage message_num, message_text [, language]sp_addremotelogin
Authorizes a new remote server user by adding an entry to master.dbo.sysremotelogins.FORMAT="LINESPECIFIC"sp_addremotelogin remoteserver [, login_name [, remote_name] ]sp_addsegment
Defines a segment on a database device in the current database.FORMAT="LINESPECIFIC"sp_addsegment segname, dbname, devnamesp_addserver
Defines a remote server, or defines the name of the local server.FORMAT="LINESPECIFIC"sp_addserver srvname [, {local | null} [, network_name]]sp_addthreshold
Creates a threshold to monitor space on a database segment. When free space on the segment falls below the specified level, SQL Server executes the associated stored procedure.FORMAT="LINESPECIFIC"sp_addthreshold database, segment, free_pages, proceduresp_addtype
Creates a user-defined datatype. FORMAT="LINESPECIFIC"sp_addtype typename, phystype [(length) | (precision [, scale])][, "identity" | nulltype]sp_addumpdevice
Adds a dump device to SQL Server.FORMAT="LINESPECIFIC"sp_addumpdevice {"tape" | "disk"}, device_name,physicalname [, size]sp_adduser
Adds a new user to the current database.FORMAT="LINESPECIFIC"sp_adduser login_name [, name_in_db [, grpname]]sp_auditdatabase
Establishes auditing of different types of events within a database, or of references to objects within that database from another database.FORMAT="LINESPECIFIC"sp_auditdatabase [dbname [, "ok | fail | both | off"[, {"d u g r t o"}]]]sp_auditlogin
Audits a SQL Server user's attempts to access tables and views; audits the text of a user's command batches; lists users on which auditing is enabled; gives the auditing status of a user; or displays the status of table, view, or command text auditing.FORMAT="LINESPECIFIC"sp_auditlogin [login_name [, "table" | "view"[, "ok" | "fail" | "both" | "off"]]]FORMAT="LINESPECIFIC"sp_auditlogin [login_name [, "cmdtext" [, "on" | "off"]]]sp_auditobject
Audits accesses to tables and views.FORMAT="LINESPECIFIC"sp_auditobject objname, dbname [, {"ok" | "fail" | "both" | "off"}       [, "{d i s u}"]]FORMAT="LINESPECIFIC"sp_auditobject {"default table"|"default view"},dbname [, {"ok" | "fail" | "both" | "off"} [, "{d i s u}"]]sp_auditoption
Enables or disables system-wide auditing and global audit options, or reports on the status of audit options.FORMAT="LINESPECIFIC"sp_auditoption {"all" | "enable auditing" | "logouts"| "server boots" | "adhoc records"} [, {"on" | "off"}]FORMAT="LINESPECIFIC"sp_auditoption {"logins" | "rpc connections" |"roles"} [, {"ok" | "fail" | "both" | "off"}]FORMAT="LINESPECIFIC"sp_auditoption "errors" [, {"nonfatal" | "fatal" | "both"}]FORMAT="LINESPECIFIC"sp_auditoption "{sa | sso | oper | navigator |   replication} commands" [, {"ok" | "fail" | "both" | "off"}]sp_auditsproc 
Audits the execution of stored procedures and triggers.FORMAT="LINESPECIFIC"sp_auditsproc [sproc_name | "all", dbname[, {"ok" | "fail" | "both" | "off"}]]FORMAT="LINESPECIFIC"sp_auditsproc "default", dbname [, {"ok" | "fail" | "both" | "off"}]sp_bindefault
Binds a default to a column or user-defined datatype. FORMAT="LINESPECIFIC"sp_bindefault defaultname, objectname [, futureonly]sp_bindmsg
Binds a user message to a referential integrity constraint or check constraint. FORMAT="LINESPECIFIC"sp_bindmsg constraint_name, message_numsp_bindrule
Binds a rule to a column or user-defined datatype.FORMAT="LINESPECIFIC"sp_bindrule rulename, objectname [, futureonly]sp_changedbowner
Changes the owner of a database. Do not change the owner of the sybsystemprocs database.FORMAT="LINESPECIFIC"sp_changedbowner login_name [, true ]sp_changegroup
Changes a user's group.FORMAT="LINESPECIFIC"sp_changegroup grpname, name_in_dbsp_checknames
Checks the current database for names that contain characters not in the 7-bit ASCII set.FORMAT="LINESPECIFIC"sp_checknamessp_checkreswords
Detects and displays identifiers that are Transact-SQL reserved words. Checks server names, device names, database names, segment names, user-defined datatypes, object names, column names, user names, login names, and remote login names.FORMAT="LINESPECIFIC"sp_checkreswords [username]sp_clearstats
Initiates a new accounting period for all server users or for a specified user. Prints statistics for the previous period by executing MOREINFO="NONE"sp_reportstats. FORMAT="LINESPECIFIC"sp_clearstats [user_name]sp_commonkey
Defines a common key-columns that are frequently joined-between two tables or views. FORMAT="LINESPECIFIC"sp_commonkey tabaname, tabbname, col1a, col1b   [, col2a, col2b, ..., col8a, col8b]sp_configure
Displays or changes configuration variables.FORMAT="LINESPECIFIC"sp_configure [config_name [, config_value]]sp_cursorinfo
Reports information about a specific cursor or all cursors that are active.FORMAT="LINESPECIFIC"sp_cursorinfo [{cursor_level | null}] [, cursor_name]sp_dboption
Displays or changes database options. FORMAT="LINESPECIFIC"sp_dboption [dbname, optname, {true | false}]sp_dbremap
Forces SQL Server to recognize changes made by MOREINFO="NONE"alter database. Run this procedure only if instructed to do so by SQL Server messages.FORMAT="LINESPECIFIC"sp_dbremap database_namesp_depends
Displays information about database object dependencies-the view(s), trigger(s), and procedure(s) that depend on a specified table or view, and the table(s) and view(s) that the specified view, trigger, or procedure depends on. FORMAT="LINESPECIFIC"sp_depends objnamesp_diskdefault
Sets a database device's status to MOREINFO="NONE"defaulton or MOREINFO="NONE"defaultoff. This indicates whether or not a database device can be used for database storage if the user does not specify a database device or specifies MOREINFO="NONE"default with the MOREINFO="NONE"create database or MOREINFO="NONE"alter database commands.FORMAT="LINESPECIFIC"sp_diskdefault logical_name {defaulton | defaultoff}sp_displaylogin
Displays information about a login account. FORMAT="LINESPECIFIC"sp_displaylogin [login_name]sp_dropalias
Removes the alias user name identity established with MOREINFO="NONE"sp_addalias.FORMAT="LINESPECIFIC"sp_dropalias login_namesp_dropdevice
Drops a SQL Server database device or dump device.FORMAT="LINESPECIFIC"sp_dropdevice device_namesp_dropgroup
Drops a group from a database.FORMAT="LINESPECIFIC"sp_dropgroup grpnamesp_dropkey
Removes from the syskeys table a key that had been defined using MOREINFO="NONE"sp_primarykey, MOREINFO="NONE"sp_foreignkey, or MOREINFO="NONE"sp_commonkey.FORMAT="LINESPECIFIC"sp_dropkey keytype, tabaname [, tabbname]sp_droplanguage
Drops an alternate language from the server and removes its row from master.dbo.syslanguages.FORMAT="LINESPECIFIC"sp_droplanguage language [, dropmessages]sp_droplogin
Drops a SQL Server user login by deleting the user's entry in master.dbo.syslogins.FORMAT="LINESPECIFIC"sp_droplogin login_namesp_dropmessage
Drops user-defined messages from sysusermessages.FORMAT="LINESPECIFIC"sp_dropmessage message_number [, language]sp_dropremotelogin
Drops a remote user login.FORMAT="LINESPECIFIC"sp_dropremotelogin remoteserver [, login_name [, remotename] ]sp_dropsegment
Drops a segment from a database or unmaps a segment from a particular database device.FORMAT="LINESPECIFIC"sp_dropsegment segname, dbname [, devname]sp_dropserver
Drops a server from the list of known servers.FORMAT="LINESPECIFIC"sp_dropserver server [, droplogins]sp_dropthreshold
Removes a free-space threshold from a segment.FORMAT="LINESPECIFIC"sp_dropthreshold database, segment, free_pagessp_droptype
Drops a user-defined datatype.FORMAT="LINESPECIFIC"sp_droptype typenamesp_dropuser
Drops a user from the current database.FORMAT="LINESPECIFIC"sp_dropuser name_in_dbsp_estspace
Estimates the amount of space required for a table and its indexes, and the time needed to create the index.FORMAT="LINESPECIFIC"sp_estspace table_name, no_of_rows [, fill_factor[, cols_to_max [, textbin_len [, iosec]]]]sp_extendsegment
Extends the range of a segment to another database device, or extends an existing segment on the current database device.FORMAT="LINESPECIFIC"sp_extendsegment segname, dbname, devnamesp_foreignkey
Defines a foreign key on a table or view in the current database.FORMAT="LINESPECIFIC"sp_foreignkey tabname, pktabname, col1 [, col2] ... [, col8]sp_getmessage
Retrieves stored message strings from sysmessages and sysusermessages for MOREINFO="NONE"print and MOREINFO="NONE"raiserror statements. FORMAT="LINESPECIFIC"sp_getmessage message_num, @msg_var output [, language]sp_help
Reports information about a database object (any object listed in sysobjects), and about SQL Server-supplied or user-defined datatypes. FORMAT="LINESPECIFIC"sp_help [objname]sp_helpconstraint
Reports information about any integrity constraints specified for a table. This information includes the constraint name and the definition of the default, unique/primary key constraint, referential constraint, or check constraint.FORMAT="LINESPECIFIC"sp_helpconstraint tabname [, detail]sp_helpdb
Reports information about a particular database or about all databases. FORMAT="LINESPECIFIC"sp_helpdb [dbname]sp_helpdevice
Reports information about a particular device or about all SQL Server database devices and dump devices.FORMAT="LINESPECIFIC"sp_helpdevice [device_name]sp_helpgroup
Reports information about a particular group or about all groups in the current database.FORMAT="LINESPECIFIC"sp_helpgroup [grpname]sp_helpindex
Reports information about the indexes created on a table.FORMAT="LINESPECIFIC"sp_helpindex tabnamesp_helpjoins
Lists the columns in two tables or views that are likely join candidates. FORMAT="LINESPECIFIC"sp_helpjoins lefttab, righttabsp_helpkey
Reports information about a primary, foreign, or common key of a particular table or view, or about all keys in the current database.FORMAT="LINESPECIFIC"sp_helpkey [objname]sp_helplanguage
Reports information about a particular alternate language or about all languages.FORMAT="LINESPECIFIC"sp_helplanguage [language]sp_helplog
Reports the name of the device that contains the first page of the log.FORMAT="LINESPECIFIC"sp_helplogsp_helpremotelogin
Reports information about a particular remote server's logins or about all remote servers' logins. FORMAT="LINESPECIFIC"sp_helpremotelogin [remoteserver [,remotename]]sp_helprotect
Reports on permissions for database objects, users, or groups.FORMAT="LINESPECIFIC"sp_helprotect [name [, name_in_db [, "grant"]]]sp_helpsegment
Reports information on a particular segment or on all of the segments in the current database.FORMAT="LINESPECIFIC"sp_helpsegment [segname]sp_helpserver
Reports information about a particular remote server or about all remote servers. FORMAT="LINESPECIFIC"sp_helpserver [server]sp_helpsort
Displays SQL Server's default sort order and character set. FORMAT="LINESPECIFIC"sp_helpsortsp_helptext
Prints the text of a system procedure, trigger, view, default, rule, or integrity check constraint.FORMAT="LINESPECIFIC"sp_helptext objnamesp_helpthreshold
Reports the segment, free-space value, status, and stored procedure associated with all thresholds in the current database or all thresholds for a particular segment.FORMAT="LINESPECIFIC"sp_helpthreshold [segment_name]sp_helpuser
Reports information about a particular user or about all users in the current database.FORMAT="LINESPECIFIC"sp_helpuser [name_in_db]sp_indsuspect
Checks user tables for indexes that have been marked as suspect during recovery following a sort order change.FORMAT="LINESPECIFIC"sp_indsuspect [table_name]sp_lock
Reports information about processes that currently hold locks.FORMAT="LINESPECIFIC"sp_lock [spid1 [, spid2]]sp_locklogin
Locks a SQL Server account so that the user cannot log in, or displays a list of all locked accounts.FORMAT="LINESPECIFIC"sp_locklogin [login_name, "{lock | unlock}"]sp_logdevice
Puts the system table syslogs, which contains the transaction log, on a separate database device.FORMAT="LINESPECIFIC"sp_logdevice dbname, device_namesp_modifylogin
Modifies the default database, default language, or full name for a SQL Server login account.FORMAT="LINESPECIFIC"sp_modifylogin login_name, option, valuesp_modifythreshold
Modifies a threshold by associating it with a different threshold procedure, level of free space, or segment. You cannot use MOREINFO="NONE"sp_modifythreshold to change the amount of free space or the segment name for the last-chance threshold.FORMAT="LINESPECIFIC"sp_modifythreshold database, segment, free_pages[, new_procedure] [, new_free_pages] [, new_segment]sp_monitor
Displays statistics about SQL Server.FORMAT="LINESPECIFIC"sp_monitorsp_password
Adds or changes a password for a SQL Server login account.FORMAT="LINESPECIFIC"sp_password caller_passwd, new_passwd [, login_name]sp_placeobject
Puts future space allocations for a table or index on a particular segment. FORMAT="LINESPECIFIC"sp_placeobject segname, objnamesp_primarykey
Defines a primary key on a table or view.FORMAT="LINESPECIFIC"sp_primarykey tabname, col1 [, col2, col3, ..., col8]sp_procxmode
Displays or changes the transaction modes associated with stored procedures.FORMAT="LINESPECIFIC"sp_procxmode [procedure_name [, transaction_mode]]sp_recompile
Causes each stored procedure and trigger that uses the named table to be recompiled the next time it runs.FORMAT="LINESPECIFIC"sp_recompile tabnamesp_remap
Remaps a Release 4.8 or later stored procedure, trigger, rule, default, or view to be compatible with Release 10.0. UseMOREINFO="NONE" sp_remap on objects that the Release 10.0 upgrade procedure failed to remap.FORMAT="LINESPECIFIC"sp_remap object_namesp_remoteoption
Displays or changes remote login options.FORMAT="LINESPECIFIC"sp_remoteoption [remote_server, login_name,remote_name, opt_name, {true | false}]sp_rename
Changes the name of a user-created object in the current database.FORMAT="LINESPECIFIC"sp_rename objname, newnamesp_renamedb
Changes the name of a database. You cannot rename system databases or databases with external referential integrity constraints.FORMAT="LINESPECIFIC"sp_renamedb dbname, newnamesp_reportstats
Reports statistics on system usage.FORMAT="LINESPECIFIC"sp_reportstats [user_name]sp_role
Grants or revokes roles to a SQL Server login account. FORMAT="LINESPECIFIC"sp_role {"grant" | "revoke"}, {sa_role | sso_role | oper_role}, login_namesp_serveroption
Displays or changes remote server options.FORMAT="LINESPECIFIC"sp_serveroption [server, optname, {true | false}]sp_setlangalias
Assigns or changes the alias for an alternate language.FORMAT="LINESPECIFIC"sp_setlangalias language, aliassp_spaceused
Displays the number of rows, the number of data pages, and the space used by one table or by all tables in the current database.FORMAT="LINESPECIFIC"sp_spaceused [tablename]sp_syntax
Displays the syntax of Transact-SQL statements, system procedures, utilities, and other routines (depending on which products and corresponding MOREINFO="NONE"sp_syntax scripts exist on your server). FORMAT="LINESPECIFIC"sp_syntax {command | fragment} [, module_name][, language]sp_thresholdaction
Executes automatically when the number of free pages on the log segment falls below the last-chance threshold (unless the threshold has been associated with a different procedure). Sybase does not provide this procedure.FORMAT="LINESPECIFIC"sp_thresholdaction @dbname,     @segment_name,     @space_left,     @statussp_unbindefault
Unbinds a created default value from a column or from a user-defined datatype.FORMAT="LINESPECIFIC"sp_unbindefault objname [, futureonly]sp_unbindmsg
Unbinds a user-defined message from a constraint.FORMAT="LINESPECIFIC"sp_unbindmsg constraint_namesp_unbindrule
Unbinds a rule from a column or from a user-defined datatype.FORMAT="LINESPECIFIC"sp_unbindrule objname [, futureonly]sp_volchanged
Notifies the Backup Server that the operator performed the requested volume handling during a dump or load.FORMAT="LINESPECIFIC"sp_volchanged session_id, device_name, action[, filename [, volume_name]]sp_who
Reports information  about all current SQL Server users and processes, or about  a particular user or process. FORMAT="LINESPECIFIC"sp_who [login_name | "spid"]NUMBER="5"Catalog Stored Proceduressp_column_privileges
Returns permissions information for one or more columns in a table or view.FORMAT="LINESPECIFIC"sp_column_privileges table_name [, table_owner[, table_qualifier [, column_name]]]sp_columns
Returns information about the type of data that can be stored in one or more columns.FORMAT="LINESPECIFIC"sp_columns table_name [, table_owner ][, table_qualifier] [, column_name]sp_databases
Returns a list of databases on a SQL Server.FORMAT="LINESPECIFIC"sp_databasessp_datatype_info
Returns information about a particular datatype or about all supported datatypes.FORMAT="LINESPECIFIC"sp_datatype_info [data_type]sp_fkeys
Returns logical foreign key information for the current database.  Foreign keys must have been declared through the ANSI  integrity constraint mechanism.FORMAT="LINESPECIFIC"sp_fkeys pktable_name [, pktable_owner][, pktable_qualifier] [, fktable_name] [, fktable_owner] [, fktable_qualifier]sp_pkeys
Returns primary key information for a single table. Primary keys must have been declared through the ANSI integrity constraint mechanism.FORMAT="LINESPECIFIC"sp_pkeys table_name [, table_owner] [, table_qualifier]sp_server_info
Returns a list of attribute names and matching values for SQL Server.FORMAT="LINESPECIFIC"sp_server_info [attribute_id]sp_special_columns
Returns the optimal set of columns that uniquely identify a row in a table or view; can also return a list of the columns that are automatically updated when any value in the row is updated by a transaction.FORMAT="LINESPECIFIC"sp_special_columns table_name [, table_owner] [, table_qualifier] [, col_type]sp_sproc_columns
Returns information about a stored procedure's input and return parameters.FORMAT="LINESPECIFIC"sp_sproc_columns sp_name [, sp_owner] [, sp_qualifier] [, column_name]sp_statistics
Returns a list of indexes on a single table.FORMAT="LINESPECIFIC"sp_statistics table_name [, table_owner] [, table_qualifier] [, index_name] [, is_unique]sp_stored_procedures
Returns information about one or more stored procedures.FORMAT="LINESPECIFIC"sp_stored_procedures [sp_name] [, sp_owner][, sp_qualifier]sp_table_privileges
Returns privilege information for all columns in a table or view.FORMAT="LINESPECIFIC"sp_table_privileges table_name [, table_owner[, table_qualifier]]sp_tables
Returns a list of objects that can appear in a MOREINFO="NONE"from clause.FORMAT="LINESPECIFIC"sp_tables [table_name] [, table_owner] [, table_qualifier][, table_type]NUMBER="6"Error Messages and Message NumbersRENDERAS="SECT1"Severity Levels 10 Through 18REMAP="BO--Body"Error messages with severity levels 10 through 16 are generated by problems caused by user errors, and can always be corrected by the user. Severity levels 17 and 18 do not terminate the user's session.REMAP="BO--Body"Error messages with severity levels 17 or higher should be reported to the System Administrator or Database Owner.RENDERAS="SECT1"Severity Levels 19 Through 24REMAP="BO--Body"Fatal problems generate error messages with severity levels 19 and higher. They break the user's connection to SQL Server. To continue working, the user must restart the client program.COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="123*"COLNAME="C2" COLWIDTH="295*"COLNAME="C3" COLWIDTH="467*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Severity LevelCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Explanation/CauseCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ActionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"10: Status InformationCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Not an error. The SQL Server 
provides additional information 
after certain commands have been 
executed.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"noneCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"11: Specified Database 
Object Not FoundCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SQL Server can't find an object 
referenced in the command because 
the user has made a mistake in 
typing the name of a database object, 
because the user did not specify the 
object owner's name, or because of 
confusion about which database is 
current.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Check spelling of object names, use 
owner names if the object is not 
owned by you or "dbo", and make 
sure you're in the correct database.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"12: Wrong Datatype 
EncounteredCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A problem with datatypes. For 
example, the user may have tried to 
enter a value of the wrong datatype 
into a column, or to compare 
columns of different (and 
incompatible) datatypes.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"To correct comparison problems, use 
the MOREINFO="NONE"convert function with MOREINFO="NONE"select.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"13: User Transaction 
Syntax ErrorCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0" Something is wrong with the 
current user-defined transaction. 
For example,  issuing a MOREINFO="NONE"commit  
command without having issued a 
MOREINFO="NONE"begin transaction, or  trying to roll a 
transaction back to a savepoint that 
has not been defined (sometimes 
there may be a typing or spelling 
mistake in the name of the 
savepoint).COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Severity level 13 can also indicate a 
deadlock, in which case the deadlock 
victim's process is rolled back. The 
user must restart his or her 
command.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"14: Insufficient 
Permission to Execute 
CommandCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"You don't have the permission 
necessary to execute the command 
or access the database object. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Ask the owner of the database 
object, the owner of the database, or 
the System Administrator to grant 
you permission to use the command 
or object in question.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"15: Syntax Error in SQL 
StatementsCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The user has made a mistake in the 
syntax of the command. The text of 
these error messages includes the 
line numbers on which the mistake 
occurs, and the specific word near 
which it occurs.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Retype the command.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"16: Miscellaneous User 
ErrorCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The user has made some kind of 
non-fatal mistake that doesn't fall 
into any of the other categories.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Check command syntax and 
working database context.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"17: Insufficient 
ResourcesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The command has caused SQL 
Server to run out of resources 
(usually space for the database on 
the disk) or to exceed some limit set 
by the System Administrator. These system limits include the 
number of databases that can be 
open at the same time and the 
number of connections allowed to 
SQL Server. They are stored in 
system tables, and can be checked 
with the MOREINFO="NONE"sp_configure commandCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Database Owner can  correct 
level 17 error messages indicating 
that you have run out of space. 
Other level 17 error messages should 
be corrected by the System 
Administrator.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"18: Non-Fatal Internal 
Error DetectedCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Error messages with severity level 
18 indicate some kind of internal 
software bug. However, the 
command runs to completion, and 
the connection to SQL Server is 
maintained. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"19: SQL Server Fatal 
Error in ResourceCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Some non-configurable internal 
limit has been exceeded, and SQL 
Server cannot recover gracefully. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Reconnect to SQL Server. See your 
System Administrator.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"20: SQL Server Fatal 
Error in Current ProcessCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SQL Server has encountered a bug 
in some command. The problem has 
affected only the current process; it 
is unlikely that the database itself 
has been damaged. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Run MOREINFO="NONE"dbcc diagnostics.  Reconnect to 
SQL Server. See your System 
Administrator.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"21: SQL Server Fatal 
Error in Database 
ProcessesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SQL Server has encountered a bug 
that affects all the processes in the 
current database. However, it is 
unlikely that the database itself has 
been damaged.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0" Restart SQL Server and run the 
MOREINFO="NONE"dbcc diagnostics.  Reconnect to SQL 
Server. See your System 
Administrator.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"22: SQL Server Fatal 
Error: Table Integrity 
SuspectCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The table or index specified in the 
message has been damaged at some 
previous time by a software or 
hardware problem. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"First,  restart SQL Server and run 
MOREINFO="NONE"dbcc to determine if other objects in 
the database are also damaged. If  
the problem is in the cache only, and 
not on the disk itself, restarting SQL 
Server will fix the problem.If restarting doesn't help, the 
problem is on the disk as well. 
Sometimes the problem can be 
solved by dropping the object 
specified in the error message. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"23: SQL Server Fatal 
Error: Database 
Integrity SuspectCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The integrity of the entire database 
is suspect due to damage caused at 
some previous time by a software or 
hardware problem. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Restart SQL Server and run the MOREINFO="NONE"dbcc 
diagnostics.Even when the whole database is 
suspect, the damage may be 
confined to the cache, and the disk 
itself may be fine. If so, restarting 
SQL Server with MOREINFO="NONE"startserver will fix 
the problem.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"24: Hardware Error or 
System Table CorruptionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Error messages with severity level 
24 reflect some kind of media failure 
or (in rare cases) the corruption of 
sysusages.  COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The System Administrator may 
have to reload the database. It may 
be necessary to call your hardware 
vendor.