TABLE data type, 188
avoiding returning from stored procedure, 30
definition, 188
in-built functions, 192
multi-statement table function, 188, 190
example, 191
table variables, 190
single statement table function, 188
example, 188
user defined functions, 188
table locks, 93
table variables
multi-statement table function, 190
tables
assigning triggers, 198
conceptual tables for triggers, 204
deleting table by SQL injection attack, 236
TABLOCK hint, 95
TABLOCKX hint, 95
temporary tables
cursors and, 74, 77, 78, 80
textual view of execution plan, 40
Query Analyzer, 41
SET SHOWPLAN_TEXT command, 40
thick arrows as cost measure
example, 46
execution plan, 45
timestamp column
optimistic locking row based scheme, 102
reasons for preferring, 108
TINYINT parameter
XP_AvailableMedia system stored procedure, 161
Toggle Breakpoint option
SQL Server Debugger, 60
tracing object creation and deletion
sp_trace extended stored procedures, 169
system stored procedures, 168
XP_Trace system stored procedures, 169
transactional replication, 214
triggers, 214
transactions, 65
ACID properties, 82
definition, 65
description, 81
explicit transactions, 88
guidelines for using, 90
implicit transactions, 88
locks and, 108
recovery model for database, 81
stored procedures, 88
savepoints, 90
syntax, 82
distributed transactions, 87
savepoints, 86
simple transactions, 82
triggers, 90
AFTER trigger, 207
triggers, 9, 197
@@ROWCOUNT variable, 211
actions and, 203
ordering trigger actions, 208
AFTER trigger, 198, 206
complex AFTER trigger, 208
assigning to tables, 198
assigning to views, 198
bad practice, 216
cascading triggers, 210
COMMIT TRANSACTION command, 211
compared to CHECK constraints, 127, 212
compared to stored procedures, 126, 213
conceptual tables, 204
creating triggers, 202
CREATE TRIGGER statement, 202
NOT FOR REPLICATION option, 203
data validation, 126
definition, 198
disabling trigger, 198
domain integrity, 212, 217
dropping trigger, 198
entity integrity, 216
firing on INSERT or UPDATE action, 205
COLUMNS_UPDATED test, 205
IF UPDATE test, 205
FOR trigger, 206
good practice, 216
INSTEAD OF trigger, 198, 209
nested trigger option, 214
performance issues, 198, 201
RAISERROR statement, 211
reasons for using, 200
data integrity, 200
recursion, 215
direct recursion triggers, 215
indirect recursion triggers, 215
referential integrity, 217
replication, 213
merge replication, 214
transactional replication, 214
require deferred updates, 202
ROLLBACK TRANSACTION command, 211
description of ROLLBACK, 212
transactions, 90
WITH ENCRYPTION triggers, 215
T-SQL code
compared to stored procedures
data validation, 122
database security, 122
performance, 115, 118
type of cursor, 68
DYNAMIC, 68
FAST_FORWARD, 68
KEYSET, 68
STATIC, 68
TYPE_WARNING
warnings for cursor, 69