9767410 - Index

8
I-1 Index A accessing data. See data retrieval ACID mnemonic, 1-5 ACTIVATION option (CREATE QUEUE), 9-20 AFTER triggers, 5-28 aggregates, managed, 8-22 alias data types, 2-6 to 2-7 managed, 8-22 alignment, index, 4-19 ALLOW_PAGE_LOCKS option, 4-12 ALLOW_ROW_LOCKS option, 4-12 ALTER DATABASE statement enabling recursive triggers, 5-39 filegroup management, 1-17 ALTER FUNCTION statement, 7-20 ALTER INDEX statement REINDEX clause, 4-36 REORGANIZE clause, 4-36 ALTER PARTITION FUNCTION statement, 2-25, 2-26 ALTER PROCEDURE statement, 7-8 ALTER TABLE statement, 2-15 CONSTRAINT clause, 5-8, 5-10 constraint modification, 5-8 NOCHECK option, 5-22 REFERENCE clause, 5-19 SWITCH clause, 2-25 ALTER VIEW statement, 6-13 WITH ENCRYPTION option, 6-18 ALTER XML SCHEMA COLLECTION statement, 5-48 altering. See modifying (altering) anonymous dialog security (Service Broker), 9-13 ANSI_ database options, 1-9 ANSI synonyms for data types, 2-3 APPLY operator, 3-40 approximate numeric data types, 2-3, 2-4 AS SNAPSHOT OF clause (CREATE DATABASE), 1-29 assemblies, 8-9 to 8-14, 8-18 importing, 8-11 to 8-12 permissions, 8-12 to 8-14 asymmetric keys as authenticators, 7-41 atomicity of transactions, 1-5 AUTHENTICATE permission, 7-40, 9-13 AUTHENTICATE SERVER permission, 7-40 AUTHORIZATION clause CREATE CONTRACT statement, 9-17 CREATE MESSAGE TYPE statement, 9-15 CREATE SERVICE statement, 9-21 AUTO_ database options, 1-7 AUTO mode (FOR XML), 3-4, 3-7 to 3-8 nested XML, 3-13 automatic options for databases, 1-7 automatic recovery of transactions, 1-6, 1-8 availability options for databases, 1-8 B backups partitioned tables and, 2-19 of snapshots (disallowed), 1-29 of transactions, 1-5 BEGIN DIALOG statement, 9-26 RELATED_CONVERSATION parameter, 9-31 beginning Service Broker conversations, 9-26 bigint data type, 2-3 BINARY BASE64 option (FOR XML), 3-4 binary data types, 2-4 binding relational columns and variables, 3-36 bit data type, 2-4 blocking and locking. See locking B-trees, 4-4 C CALLER option (EXECUTE AS clause), 7-38 calling parameterized stored procedures, 7-12 CASCADE option, FOREIGN KEY constraint, 5-19 cascading referential integrity, 5-19 catalog views, 1-11, 6-16 obtaining index information, 4-24 CATCH block. See TRY...CATCH blocks certificates as authenticators, 7-41 Service Broker, 9-12 char data type, 2-4 CHECK constraints, 5-7, 5-13 disabling, 5-21 classes, 8-18 mapping to, 8-22 CLR (Common Language Runtime), 8-2 to 8-8 clustered indexes, 4-4 to 4-5 partitioned, 4-19 to 4-20 tables without (heaps), 4-6 collations, column, 2-14 collections, XML schemas, 5-47 columns collations (sort orders), 2-14 defined as xml, 3-31, 3-40 indexes with multiple, 4-15 to 4-16 integrity of, 5-3, 5-4 names for, 2-14 relational, binding, 3-36 special types of, 2-15 with unique values. See UNIQUE constraints in universal tables, 3-9 to 3-10 Common Language Runtime (CLR), 8-2 to 8-8 composite indexes, 4-15 to 4-16 computed columns, 2-15 creating indexes on, 4-17 configuring databases, 1-7 consistency of transactions, 1-5 CONSTRAINT clause (CREATE/ALTER TABLE), 5-8, 5-10 constraints for data integrity, 5-5 to 5-22 considerations for, 5-21 triggers vs., 5-28 CONTENT keyword (typed XML), 5-50 context of execution, 7-36 to 7-41 context of impersonation, 7-40 to 7-41 contracts (Service Broker), 9-5, 9-17 to 9-18 controlling execution context, 7-36 to 7-41 conversation groups (Service Broker), 9-8 conversations, Service Broker architecture for, 9-7 to 9-9 beginning, 9-26 ending, 9-31 process of, 9-10 copies of databases (snapshots), 1-28 to 1-30

description

 

Transcript of 9767410 - Index

Page 1: 9767410 - Index

I-1

IndexAaccessing data. See data retrievalACID mnemonic, 1-5ACTIVATION option (CREATE QUEUE), 9-20AFTER triggers, 5-28aggregates, managed, 8-22alias data types, 2-6 to 2-7

managed, 8-22alignment, index, 4-19ALLOW_PAGE_LOCKS option, 4-12ALLOW_ROW_LOCKS option, 4-12ALTER DATABASE statement

enabling recursive triggers, 5-39filegroup management, 1-17

ALTER FUNCTION statement, 7-20ALTER INDEX statement

REINDEX clause, 4-36REORGANIZE clause, 4-36

ALTER PARTITION FUNCTION statement, 2-25, 2-26ALTER PROCEDURE statement, 7-8ALTER TABLE statement, 2-15

CONSTRAINT clause, 5-8, 5-10constraint modification, 5-8NOCHECK option, 5-22REFERENCE clause, 5-19SWITCH clause, 2-25

ALTER VIEW statement, 6-13WITH ENCRYPTION option, 6-18

ALTER XML SCHEMA COLLECTION statement, 5-48altering. See modifying (altering)anonymous dialog security (Service Broker), 9-13ANSI_ database options, 1-9ANSI synonyms for data types, 2-3APPLY operator, 3-40approximate numeric data types, 2-3, 2-4AS SNAPSHOT OF clause (CREATE DATABASE), 1-29assemblies, 8-9 to 8-14, 8-18

importing, 8-11 to 8-12permissions, 8-12 to 8-14

asymmetric keys as authenticators, 7-41atomicity of transactions, 1-5AUTHENTICATE permission, 7-40, 9-13AUTHENTICATE SERVER permission, 7-40AUTHORIZATION clause

CREATE CONTRACT statement, 9-17CREATE MESSAGE TYPE statement, 9-15CREATE SERVICE statement, 9-21

AUTO_ database options, 1-7AUTO mode (FOR XML), 3-4, 3-7 to 3-8

nested XML, 3-13automatic options for databases, 1-7automatic recovery of transactions, 1-6, 1-8availability options for databases, 1-8

Bbackups

partitioned tables and, 2-19of snapshots (disallowed), 1-29of transactions, 1-5

BEGIN DIALOG statement, 9-26RELATED_CONVERSATION parameter, 9-31

beginning Service Broker conversations, 9-26bigint data type, 2-3BINARY BASE64 option (FOR XML), 3-4binary data types, 2-4binding relational columns and variables, 3-36bit data type, 2-4blocking and locking. See lockingB-trees, 4-4

CCALLER option (EXECUTE AS clause), 7-38calling parameterized stored procedures, 7-12CASCADE option, FOREIGN KEY constraint, 5-19cascading referential integrity, 5-19catalog views, 1-11, 6-16

obtaining index information, 4-24CATCH block. See TRY...CATCH blockscertificates as authenticators, 7-41

Service Broker, 9-12char data type, 2-4CHECK constraints, 5-7, 5-13

disabling, 5-21classes, 8-18

mapping to, 8-22CLR (Common Language Runtime), 8-2 to 8-8clustered indexes, 4-4 to 4-5

partitioned, 4-19 to 4-20tables without (heaps), 4-6

collations, column, 2-14collections, XML schemas, 5-47columns

collations (sort orders), 2-14defined as xml, 3-31, 3-40indexes with multiple, 4-15 to 4-16integrity of, 5-3, 5-4names for, 2-14relational, binding, 3-36special types of, 2-15with unique values. See UNIQUE constraintsin universal tables, 3-9 to 3-10

Common Language Runtime (CLR), 8-2 to 8-8composite indexes, 4-15 to 4-16computed columns, 2-15

creating indexes on, 4-17configuring databases, 1-7consistency of transactions, 1-5CONSTRAINT clause (CREATE/ALTER TABLE), 5-8, 5-10constraints for data integrity, 5-5 to 5-22

considerations for, 5-21triggers vs., 5-28

CONTENT keyword (typed XML), 5-50context of execution, 7-36 to 7-41context of impersonation, 7-40 to 7-41contracts (Service Broker), 9-5, 9-17 to 9-18controlling execution context, 7-36 to 7-41conversation groups (Service Broker), 9-8conversations, Service Broker

architecture for, 9-7 to 9-9beginning, 9-26ending, 9-31process of, 9-10

copies of databases (snapshots), 1-28 to 1-30

Page 2: 9767410 - Index

I-2

coverage, 4-9CREATE ASSEMBLY statement, 8-11

WITH PERMISSION_SET clause, 8-13CREATE CONTRACT statement, 9-17CREATE DATABASE statement

AS SNAPSHOT OF clause, 1-29multiple filegroups, creating, 1-16

CREATE ENDPOINT statement, 9-13CREATE FUNCTION statement, 7-20, 7-22, 7-24

mapping to methods, 8-20CREATE INDEX statement, 4-11CREATE MESSAGE TYPE statement, 9-15, 9-17CREATE PARTITION FUNCTION statement, 2-21CREATE PARTITION SCHEME statement, 2-22CREATE PROCEDURE statement, 7-5, 7-11

EXECUTE AS clause, 7-38 to 7-41mapping to methods, 8-20OUTPUT keyword, 7-13

CREATE QUEUE statement, 9-19CREATE SCHEMA statement, 1-24CREATE SERVICE statement, 9-21CREATE TABLE statement

CONSTRAINT clause, 5-10constraint creation, 5-8REFERENCE clause, 5-19

CREATE TRIGGER statement, 5-28mapping to methods, 8-20

CREATE VIEW statement, 6-9WITH ENCRYPTION option, 6-18

CREATE XML SCHEMA COLLECTION statement, 5-47CURSOR_ database options, 1-8cursor options for databases, 1-8

Ddata file groups. See filegroupsdata integrity, 5-1 to 5-5

constraints, 5-5 to 5-22enforcing, options for, 5-4triggers. See triggersvalidating typed XML, 5-49XML schemas, 5-5, 5-44 to 5-50

data modification, 1-30restrictions on, 5-11triggers. See triggersXML data, 3-37 to 3-38

data portion of table rows, 2-11data retrieval, 1-30

FOR XML clause, 3-2 to 3-15AUTO mode, 3-4, 3-7 to 3-8, 3-13EXPLICIT mode, 3-4, 3-9 to 3-10, 3-15nested XML, 3-13 to 3-15PATH mode, 3-4, 3-11 to 3-12RAW mode, 3-4 to 3-6

how SQL Server accesses data, 4-3querying XML data, 3-35 to 3-36

data storagecontrolling with multiple filegroups, 1-18partitioned tables and, 2-19potential growth of, 1-4

data typesalias types, 2-6 to 2-7maintaining data integrity with, 5-4system-supplied, 2-3 to 2-5

data views. See viewsDatabase Engine Tuning Advisor, 4-29 to 4-32

database performance. See performancedatabases

creating, 1-2 to 1-12example of, 1-4options for, configuring, 1-7

file location considerations, 1-4database snapshots, 1-29partitioned tables, 2-18 to 2-26transaction log file, 1-6

integrity of. See data integritymanaged objects, 8-6, 8-17 to 8-23

aggregates, 8-22mapping to managed code, 8-18stored procedures, triggers, and functions, 8-20

masking data with views, 6-7obtaining information on, 1-10 to 1-12planning, 1-4snapshots of, 1-28 to 1-30

date and time data types, 2-3datetime data type, 2-3DB_ID function, 1-12DB_NAME function, 1-12dbo schema, 1-24deadlock, partitioned tables and, 2-20decimal data type, 2-3, 2-4DEFAULT constraints, 5-7DEFAULT option (CREATE MESSAGE TYPE), 9-18default parameters for stored procedures, 7-12default schemas, 1-25defaults for data integrity, 5-4defragmenting indexes, 4-35delete statement (XQuery), 3-38DELETE statements

responding to with triggers, 5-32. See also triggersrestrictions on, 5-20

deleting. See removingdependencies, view, 6-17detecting index fragmentation, 4-33dialog conversations (Service Broker), 9-8

handle variables, 9-26dialog security (Service Broker), 9-13direct recursion, 5-39disabling constraints, 5-21disabling nested triggers, 5-38distributed partitioned views, 6-26DML triggers, 5-5, 5-26 to 5-40

AFTER triggers, 5-28constraints vs., 5-28DELETE triggers, 5-32INSERT triggers, 5-30INSTEAD OF triggers, 5-28, 5-35managed, 8-20nested, 5-37recursive, 5-39UPDATE triggers, 5-33

DOCUMENT keyword (typed XML), 5-50domain integrity, 5-3

enforcing, 5-4DROP ASSEMBLY statement, 8-11DROP FUNCTION statement, 7-20DROP PROCEDURE statement, 7-9DROP TABLE statement, 2-15DROP TYPE statement, 2-7DROP VIEW statement, 6-13DROP XML SCHEMA COLLECTION statement, 5-48

coverage

Page 3: 9767410 - Index

I-3

dropping (removing)assemblies, 8-11dropping views, 6-14functions, 7-20stored procedures, 7-8tables, 2-15XML data, 3-38XML schema collections, 5-48

durability of transactions, 1-5

Eediting. See modifying (altering)ELEMENTS option (FOR XML), 3-4, 3-6, 3-8, 3-13EMERGENCY database option, 1-8encrypting Service Broker dialogs, 9-27encrypting views, 6-18END CONVERSATION statement, 9-31ending Service Broker conversations, 9-31enforcing data integrity, 5-4entity integrity, 5-3

enforcing, 5-4error handing, 7-28 to 7-33Evaluate mode (Database Engine Tuning Advisor), 4-30exact numeric data types, 2-3, 2-4EXECUTE AS clause

CREATE PROCEDURE/FUNCTION statements, 7-38 to 7-41CREATE QUEUE statement, 9-20

execution context, 7-36 to 7-41exist method (XQuery), 3-35 to 3-36, 3-39EXPLICIT mode (FOR XML), 3-4, 3-9 to 3-10

nested XML, 3-15explicit vs. implicit transactions, 1-5external fragmentation of indexes, 4-33EXTERNAL NAME clause, 8-20, 8-22EXTERNAL_ACCESS option (assembly trust level), 8-13

Ffailed transactions, rolling back, 7-31federated servers, partitioning and, 6-27file location considerations, 1-4

database snapshots, 1-29partitioned tables, 2-18 to 2-26transaction log file, 1-6

file storage. See data storageFILEGROUP_ID function, 1-12FILEGROUP_NAME function, 1-12filegroups, 1-15 to 1-19

mapping partitioned tables to, 2-22when to create, 1-18

FILE_ID function, 1-12FILE_NAME function, 1-12FILLFACTOR option, 4-21fixed-length data types, 2-5, 2-11float data type, 2-3, 2-5FLOWR statements, 3-34for statement (XQuery), 3-34FOR XML clause, 3-2 to 3-15

AUTO mode, 3-4, 3-7 to 3-8, 3-13EXPLICIT mode, 3-4, 3-9 to 3-10, 3-15nested XML, 3-13 to 3-15PATH mode, 3-4, 3-11 to 3-12RAW mode, 3-4 to 3-6

FOREIGN KEY constraints, 5-7, 5-17cascading referential integrity, 5-19disabling, 5-21triggers vs., 5-28

fragmentation of indexes, 4-33 to 4-36

free space in indexes, 4-21 to 4-22full dialog security (Service Broker), 9-13functions, 7-18 to 7-25

managed, 8-20for obtaining metadata, 1-12types of, 7-19

Gglobal identifiers, 2-4GO command, 7-6growth of physical data storage, 1-4

Hhandle variables for dialogs, 9-26handling errors, 7-28 to 7-33header, table rows, 2-11heaps, 4-6

Iidentity columns, 2-15IGNORE_DUP_KEY clause (CREATE INDEX), 4-13image data type, 2-4, 2-5, 2-12impersonation context, 7-40 to 7-41implicit transactions, 1-5importing assemblies, 8-11 to 8-12included columns in indexes, 4-16index keys, 4-20indexed views, 6-5, 6-24indexes, 4-1 to 4-9

alignment of, 4-19creating, 4-10 to 4-22

on computed columns, 4-17incorporating free space, 4-21 to 4-22

obtaining information about, 4-23 to 4-25optimizing, 4-28 to 4-36partitioned, 2-19, 4-19 to 4-20types of

clustered indexes, 4-4 to 4-5composite indexes, 4-15 to 4-16heaps, 4-6nonclustered indexes, 4-8 to 4-9, 4-16unique indexes, 4-13

XML indexes, 4-39 to 4-43indirect recursion, 5-39information about databases, obtaining, 1-10 to 1-12initiating Service Broker conversations, 9-26inline table-valued functions, 7-19, 7-22in-memory node trees, 3-21input parameters for stored procedures, 7-11 to 7-12insert statement (XQuery), 3-37INSERT statements

responding to with triggers, 5-30. See also triggersrestricting data values for. See CHECK constraints

INSTEAD OF triggers, 5-28, 5-35int data type, 2-3integer data types, 2-3integrity of data, 5-1 to 5-5

constraints, 5-5 to 5-22enforcing, options for, 5-4triggers. See triggersvalidating typed XML, 5-49XML schemas, 5-5, 5-44 to 5-50

intermediate notes (indexes), 4-4. See also indexesinternal fragmentation of indexes, 4-33interoperability of managed code, 8-5invoking functions, 7-21, 7-23, 7-25isolation of transactions, 1-5

isolation of transactions

Page 4: 9767410 - Index

I-4

J-LJOIN operations, performance with partitioned tables, 2-20key values for clustered indexes, 4-5large data values

data types for, 2-5how organized in tables, 2-12 to 2-13

“large value types out of row” option, 2-13leaf level (indexes), 4-4. See also indexesLEFT partition functions, 2-21let statement (XQuery), 3-34linking objects to managed code, 8-18LOB data types. See large data valueslocal partitioned views, 6-6, 6-26local variables for Service Broker dialogs, 9-29location of database files, 1-4

database snapshots, 1-29partitioned tables, 2-18 to 2-26transaction log file, 1-6

lockingindexes, options for, 4-12partitioned tables and, 2-20

logging transactions, 1-5lost transactions, 1-5

Mmanaged code, 8-1 to 8-24

importing and configuring assemblies, 8-9 to 8-14mapping database objects to, 8-18when to use, 8-8

managed objects, 8-6, 8-17 to 8-23aggregates, 8-22mapping to managed code, 8-18stored procedures, triggers, and functions, 8-20

mapping objects to managed code, 8-18masking databases with views, 6-7master database, snapshots of (disallowed), 1-29max specifier in data types, 2-5, 2-13MAX_QUEUE_READER option (CREATE QUEUE), 9-20media, storage. See data storagemerging partitions, 2-25messages (Service Broker), 9-7

queues, 9-6, 9-19 to 9-20receiving, 9-29 to 9-31sending, 9-26 to 9-28types of, 9-5, 9-15 to 9-16, 9-28, 9-31

metadata, obtainingabout databases, 1-10 to 1-12functions for, 1-12about indexes, 4-23 to 4-25about views, 6-16about XML schema collections, 5-48

methods, 8-18mapping to, 8-20

model databaseoptions for, 1-7snapshots of (disallowed), 1-29

modify method (XQuery), 3-37 to 3-38modifying (altering)

data constraints, 5-8data in databases, 1-30

restrictions on, 5-11triggers. See triggersXML data, 3-37 to 3-38

functions, 7-20stored procedures, 7-8tables, 2-15

views, 6-13, 6-19XML schema collections, 5-48

monetary data types, 2-3money data type, 2-3multi-statement table-valued functions, 7-19, 7-24MULTI_USER database option, 1-8

Nname resolution, 1-25namespaces, 8-18, 8-20

schemas as, 1-23XML namespaces, 3-26, 3-34

native XML storage and functionality, 3-31 to 3-32nchar data type, 2-4, 2-5nested triggers, 5-37nested views, 6-23nested XML, retrieving, 3-7, 3-13 to 3-15.NET assemblies. See assemblies.NET Common Language Runtime, 8-2 to 8-8NOCHECK option (ALTER TABLE), 5-22nodes (indexes), defined, 4-4. See also indexesnodes method (XQuery), 3-39 to 3-40nonclustered indexes, 4-8 to 4-9, 4-16

partitioned, 4-19 to 4-20nonkey columns in indexes, 4-16non-Unicode character data types, 2-4NOT NULL option, 2-7ntext data type, 2-4, 2-12null blocks, 2-11NULL constraints, 5-7nullability

alias data types, 2-7table definitions, 2-14

numeric data type, 2-3, 2-4nvarchar data type, 2-4, 2-5, 2-13

OObject Explorer (SQL Server Management Studio), 1-10

obtaining index information, 4-23object name resolution, 1-25objects, managed, 8-6, 8-17 to 8-23

aggregates, 8-22mapping to managed code, 8-18stored procedures, triggers, and functions, 8-20

OFFLINE database option, 1-8offline index queries, 4-12OLAP databases, 1-3OLTP databases, 1-3ON option (CREATE QUEUE), 9-20ON DELETE clause, FOREIGN KEY constraint, 5-20ON UPDATE clause, FOREIGN KEY constraint, 5-19ONLINE database option, 1-8ONLINE option, 4-12OPENXML function, 3-20, 3-23 to 3-25

namespaces with, 3-26optimizing indexes, 4-28 to 4-36

Database Engine Tuning Advisor, 4-29 to 4-32fragmentation management, 4-33 to 4-36

optimizing performance. See performanceORDER BY clause (ALTER PROCEDURE), 7-8order by statement (XQuery), 3-34OUTPUT keyword (CREATE PROCEDURE), 7-13output parameters for stored procedures, 7-13 to 7-14OWNER (EXECUTE AS clause), 7-38ownership chains (views), 6-15

JOIN operations, performance with partitioned tables

Page 5: 9767410 - Index

I-5

PPAD_INDEX option, 4-22page splits with indexes, 4-33 to 4-36page-level locks (indexes), 4-12PAGE_VERIFY database option, 1-9parameterized stored procedures, 7-10 to 7-14

input parameters, 7-11 to 7-12output parameters and return values, 7-13 to 7-14

Parent column (universal tables), 3-9partition functions, 2-21partition keys, 4-20partition schemes, 2-22partitioned indexes, 4-19 to 4-20partitioned tables, 2-18 to 2-26partitioned views, 6-5, 6-6, 6-26PATH mode (FOR XML), 3-4, 3-11 to 3-12path XML indexes, 4-42performance

file location considerations, 1-4database snapshots, 1-29partitioned tables, 2-18 to 2-26transaction log file, 1-6

indexesincorporated free space, 4-21 to 4-22nonclustered indexes, 4-9optimizing, 4-28 to 4-36

optimizing with views, 6-22 to 6-27partitioned tables, 2-20single vs. multiple filegroups, 1-18

permissionsassemblies, 8-12 to 8-14AUTHENTICATE permission, 7-40execution context, 7-36 to 7-41views, 6-7, 6-10, 6-15

physical data storagecontrolling with multiple filegroups, 1-18partitioned tables and, 2-19potential growth of, 1-4

planning databases, 1-4. See also data integrityplanning indexes, 4-2 to 4-9

clustered indexes, 4-4 to 4-5partitioned, 4-19 to 4-20tables without (heaps), 4-6

heaps, 4-6nonclustered indexes, 4-8 to 4-9, 4-16

potential growth of physical data storage, 1-4primary filegroups, 1-16PRIMARY KEY constraints, 4-7, 5-7, 5-9primary XML indexes, 4-42procedures. See functions; stored proceduresprocessing Service Broker messages, 9-31Properties window (SQL Server Management Studio), 1-10

obtaining index information, 4-23property XML indexes, 4-42, 4-43purposes of database, 1-4

Qquality of data. See data integrityquery method (XQuery), 3-35 to 3-36, 3-39queues (Service Broker), 9-6, 9-19 to 9-20

RRAID, single filegroups vs., 1-18RAW mode (FOR XML), 3-4 to 3-6RDBMS component, SQL Server, 1-3READ_ONLY database option, 1-8

READ_WRITE database option, 1-8real data type, 2-3, 2-5rebuilding indexes, 4-35 to 4-36RECEIVE statement, 9-29receiving messages (Service Broker), 9-29 to 9-31recovering transactions, 1-6, 1-8RECOVERY database option, 1-8recursive triggers, 5-39RECURSIVE_TRIGGER database option, 1-9REFERENCE clause (CREATE/ALTER TABLE), 5-19referencing XML schemas, 5-49referential integrity, 5-3

cascading, 5-19disallowing rollback of changes, 5-28enforcing, 5-5

REINDEX clause (ALTER INDEX), 4-36RELATED_CONVERSATION parameter (BEGIN DIALOG), 9-31remote service binding, 9-9removing

assemblies, 8-11dropping views, 6-14functions, 7-20stored procedures, 7-8tables, 2-15XML data, 3-38XML schema collections, 5-48

REORGANIZE clause (ALTER INDEX), 4-36reorganizing indexes, 4-35 to 4-36replace statement (XQuery), 3-38reports (SQL Server Management Studio), 1-10

obtaining index information, 4-23restoring from backups. See backupsRESTRICTED_USER database option, 1-8RETENTION option (CREATE QUEUE), 9-20retrieving data from databases, 1-30

FOR XML clause, 3-2 to 3-15AUTO mode, 3-4, 3-7 to 3-8, 3-13EXPLICIT mode, 3-4, 3-9 to 3-10, 3-15nested XML, 3-13 to 3-15PATH mode, 3-4, 3-11 to 3-12RAW mode, 3-4 to 3-6

how SQL Server accesses data, 4-3querying XML data, 3-35 to 3-36

RETURN statement, 7-14return statement (XQuery), 3-34return values for stored procedures, 7-13 to 7-14RIGHT partition functions, 2-21rolling back failed transactions, 7-31root node (indexes), 4-4. See also indexesROOT option (FOR XML), 3-4, 3-6, 3-42routes, message (Service Broker), 9-8row organization within tables, 2-11row-level locks (indexes), 4-12rowsets, processing XML data as. See shredding XML datarules for data integrity, 5-4runtimes, 8-2 to 8-8

SSAFE option (assembly trust level), 8-13scalar functions, 7-19 to 7-21schemas, 1-22 to 1-25

object name resolution, 1-25OPENXML function with, 3-24XML schemas, 5-5, 5-44 to 5-50

searching databases with partitioned indexes, 2-20secondary XML indexes, 4-42

secondary XML indexes

Page 6: 9767410 - Index

I-6

securityassembly permissions, 8-12encrypting views, 6-18execution context, 7-36 to 7-41managed code, 8-5masking databases with views, 6-7Service Broker, 9-12 to 9-13

SELECT statementsFOR XML clause, 3-2 to 3-15

AUTO mode, 3-4, 3-7 to 3-8, 3-13EXPLICIT mode, 3-4, 3-9 to 3-10, 3-15nested XML, 3-13 to 3-15PATH mode, 3-4, 3-11 to 3-12RAW mode, 3-4 to 3-6

OPENXML function in, 3-20, 3-23 to 3-25namespaces with, 3-26

WITH CHECK OPTION clause, 6-19SELF (EXECUTE AS clause), 7-38SEND statement, 9-28sending messages (Service Broker), 9-26 to 9-28Service Broker, 9-2 to 9-24

architecture and functionalityconversation architecture, 9-7 to 9-9conversation process, 9-10security, 9-12 to 9-13system architecture, 9-5 to 9-6

creating broker objects, 9-14 to 9-22sending and receiving messages, 9-26 to 9-31

service objects, 9-6, 9-21service programs, 9-6shredding XML data, 3-19 to 3-27signing, 7-41SINGLE_USER database option, 1-8smalldatetime data type, 2-3smallint data type, 2-3smallmoney data type, 2-3snapshots, database, 1-28 to 1-30sort order for column data, 2-14sources of database information, 1-10 to 1-12sp_ procedures, in general. See stored proceduressp_depends procedure, 7-9special column types, 2-15special data types, 2-4sp_helpconstraint procedure, 5-21sp_helpindex procedure, 4-23splitting partitions, 2-26sp_tableoption procedure, 2-12, 2-13sp_xml_prepareddocument procedure, 3-20, 3-21, 3-26sp_xml_removeddocument procedure, 3-20, 3-22SQL options for databases, 1-9SQL Server, 1-3

assemblies in, 8-10Common Language Runtime (CLR), 8-2 to 8-8

SQL Server Management Studio, 1-10sql_variant data type, 2-4standard views, 6-5starting Service Broker conversations, 9-26STATUS option (CREATE QUEUE), 9-19storage. See data storagestored procedures, 7-2 to 7-9

altering and dropping, 7-8creating, 7-5 to 7-8EXECUTE AS clause, 7-38 to 7-41managed, 8-20obtaining database information, 1-12obtaining index information, 4-23parameterized, 7-10 to 7-14

storing messages. See queues (Service Broker)

structured exception handling, 7-29SWITCH clause (ALTER TABLE), 2-25switching partitions, 2-25sys catalog views, 1-11, 6-16

obtaining index information, 4-24sys.dm_index_ functions, 4-24, 4-33sysindexes system table, 4-21sysname data type, 2-4system stored procedures, 7-2 to 7-9

altering and dropping, 7-8creating, 7-5 to 7-8EXECUTE AS clause, 7-38 to 7-41managed, 8-20obtaining database information, 1-12obtaining index information, 4-23parameterized, 7-10 to 7-14

system-supplied data types, 2-3 to 2-5

Ttable data type, 2-4table-level locks (indexes), 4-12tables, 2-10 to 2-15

without clustered indexes (heaps), 4-6large data values, 2-12 to 2-13modifying and removing, 2-15partitioned, 2-18 to 2-26row organization, 2-11virtual. See views

table-valued functions, 7-19, 7-22 to 7-25Tag column (universal tables), 3-9tempdb database, snapshots of (disallowed), 1-29text data type, 2-4, 2-5, 2-12“text in row” option, 2-12time and date data types, 2-3timestamp columns, 2-15timestamp data type, 2-4tinyint data type, 2-3TOP parameter, RECEIVE statement, 9-29transactions

defined, 1-5failed, rolling back, 7-31logging, 1-5throughput, 1-4

Transact-SQL, managed code vs., 8-8transport security (Service Broker), 9-13triggers, 5-5, 5-26 to 5-40

AFTER triggers, 5-28constraints vs., 5-28DELETE triggers, 5-32INSERT triggers, 5-30INSTEAD OF triggers, 5-28, 5-35managed, 8-20nested, 5-37recursive, 5-39UPDATE triggers, 5-33

trust levels, assemblies, 8-12 to 8-14trust relationships, 7-40TRY...CATCH blocks, 7-29 to 7-33

XACT_ABORT and XACT_STATE options, 7-32Tune mode (Database Engine Tuning Advisor), 4-30tuning indexes, 4-28 to 4-36

Database Engine Tuning Advisor, 4-29 to 4-32fragmentation management, 4-33 to 4-36

TYPE option (FOR XML), 3-4, 3-14type safety, 8-5typed XML, 5-44, 5-49types. See data types

security

Page 7: 9767410 - Index

I-7

UUDDTs. See alias data typesUnicode character data types, 2-4UNIQUE constraints, 5-7, 5-15unique indexes, 4-13uniqueidentifier data type, 2-4, 2-15universal tables, 3-9 to 3-10UNSAFE option (assembly trust level), 8-13untyped XML, 5-44UPDATE statements

responding to with triggers, 5-33. See also triggersrestricting data values for, 5-11

updating data. See data modificationuser-defined data types, 2-6 to 2-7

managed, 8-22user-defined filegroups, 1-16

Vvalidating typed XML, 5-49VALIDATION clause (CREATE MESSAGE TYPE), 9-15value method (XQuery), 3-35 to 3-36, 3-39value XML indexes, 4-42, 4-43varbinary data type, 2-4, 2-5, 2-13varchar data type, 2-4, 2-5, 2-13variable blocks, 2-11variable-length data types, 2-3, 2-5viewing XML schema information, 5-48views, 6-1 to 6-7

altering and dropping, 6-13, 6-19catalog views, 1-11, 6-16

obtaining index information, 4-24creating, 6-9 to 6-10encrypting, 6-18indexed views, 6-5, 6-24multi-statement table-valued functions, 7-19, 7-24obtaining information on, 6-16optimizing performance with, 6-22 to 6-27ownership chains, 6-15partitioned views, 6-5, 6-6, 6-26types of, 6-5

virtual tables. See views

Wwhere statement (XQuery), 3-34WITH CHECK OPTION clause, 6-19WITH CLEANUP clause (END CONVERSATION), 9-31WITH ENCRYPTION option

ALTER PROCEDURE statement, 7-8CREATE/ALTER VIEW statement, 6-18

WITH ERROR clause (END CONVERSATION), 9-31WITH NOCHECK option (ALTER TABLE), 5-22WITH option (CREATE INDEX), 4-11WITH PERMISSION_SET clause (CREATE ASSEMBLY), 8-13

XXACT_ABORT option (TRY...CATCH), 7-32XACT_STATE option (TRY...CATCH), 7-32XML

FOR XML clause, 3-2 to 3-15AUTO mode, 3-4, 3-7 to 3-8, 3-13EXPLICIT mode, 3-4, 3-9 to 3-10, 3-15nested XML, 3-13 to 3-15PATH mode, 3-4, 3-11 to 3-12RAW mode, 3-4 to 3-6

in-memory node trees, 3-21namespaces, working with, 3-26

declaring in XQuery queries, 3-34query, value, and exist methods, 3-35 to 3-36shredding XML data, 3-19 to 3-27typed, 5-44, 5-49

xml data type, 2-4, 3-30 to 3-40extracting data from, 3-39 to 3-40indexes of columns with, 4-39 to 4-43native XML storage and functionality, 3-31 to 3-32

XML indexes, 4-39 to 4-43XML schema collections, 5-47XML schemas, 5-5, 5-44 to 5-50XMLDATA option (FOR XML), 3-4XMLSCHEMA option (FOR XML), 3-4XPath syntax, 3-11

schema declarations with, 3-24XML namespaces with, 3-26

XQuery specification, 3-31 to 3-34

XQuery specification

Page 8: 9767410 - Index