|
|
xxv | |
|
|
xxxix | |
Foreword |
|
xliii | |
|
Foreword |
|
xlv | |
|
Preface |
|
xlix | |
Acknowledgments |
|
lv | |
About the Authors |
|
lvii | |
|
|
1 | (26) |
|
The .NET Framework and the Microsoft Platform |
|
|
1 | (2) |
|
The .NET Framework's Effects on SQL Server |
|
|
3 | (5) |
|
The SQL:1999 Standard: Extending the Relational Model |
|
|
8 | (3) |
|
User-Defined Types and SQL Server |
|
|
11 | (3) |
|
XML: Data and Document Storage |
|
|
14 | (6) |
|
Web Services: XML As a Marshaling Format |
|
|
20 | (2) |
|
Client Access . . . And Then There Are Clients |
|
|
22 | (2) |
|
Client-Side Database APIs and SQL Server 2005 |
|
|
22 | (1) |
|
Client-Side XML-Based APIs and SQL Server 2005 Integration |
|
|
23 | (1) |
|
Extending SQL Server into the Platform: Service Broker and Notification Services |
|
|
24 | (2) |
|
|
26 | (1) |
|
Hosting the Runtime: SQL Server As a Runtime Host |
|
|
27 | (34) |
|
Why Care How Hosting Works? |
|
|
27 | (2) |
|
What Is a .NET Framework Runtime Host? |
|
|
29 | (2) |
|
SQL Server As a Runtime Host |
|
|
31 | (9) |
|
SQL Server Resource Management |
|
|
31 | (3) |
|
Exceptional Condition Handling |
|
|
34 | (3) |
|
|
37 | (2) |
|
|
39 | (1) |
|
Loading the Runtime: Processes and AppDomains |
|
|
40 | (3) |
|
Safe Code: How the Runtime Makes It Safer to Run ``Foreign'' Code |
|
|
43 | (3) |
|
Where the Code Lives: Storing .NET Framework Assemblies (Create Assembly) |
|
|
46 | (3) |
|
Assembly Dependencies: When Your Assemblies Use Other Assemblies |
|
|
49 | (2) |
|
Assemblies and SQL Schemas: Who Owns Assemblies (Information Schema) |
|
|
51 | (4) |
|
System Metadata Tables and Information_Schema |
|
|
52 | (1) |
|
|
53 | (2) |
|
Maintaining User Assemblies (Alter Assembly, Drop Assembly) |
|
|
55 | (3) |
|
|
58 | (2) |
|
|
60 | (1) |
|
|
60 | (1) |
|
Procedures and Functions in .NET CLR Languages |
|
|
61 | (50) |
|
|
61 | (2) |
|
|
63 | (11) |
|
|
74 | (3) |
|
|
77 | (16) |
|
A Few Words About Null Values |
|
|
77 | (3) |
|
|
80 | (13) |
|
Parameters and Return Value |
|
|
93 | (1) |
|
|
93 | (6) |
|
|
99 | (7) |
|
|
106 | (3) |
|
|
109 | (1) |
|
|
110 | (1) |
|
|
111 | (42) |
|
Programming with SqlClient |
|
|
111 | (4) |
|
Context: The SqlContext Class |
|
|
115 | (3) |
|
|
118 | (3) |
|
Commands: Making Things Happen |
|
|
121 | (3) |
|
|
124 | (4) |
|
|
128 | (7) |
|
|
132 | (1) |
|
|
133 | (2) |
|
|
135 | (2) |
|
Creating and Sending New Rowsets |
|
|
137 | (2) |
|
Using the WindowsIdentity |
|
|
139 | (1) |
|
Calling a Web Service from SQLCLR |
|
|
140 | (3) |
|
|
143 | (6) |
|
|
149 | (1) |
|
SqlClient Classes That You Can't Use on the Server |
|
|
150 | (1) |
|
|
151 | (2) |
|
User-Defined Types and Aggregates |
|
|
153 | (66) |
|
Why Do We Need User-Defined Types? |
|
|
153 | (1) |
|
Overview of User-Defined Types |
|
|
154 | (3) |
|
Creating a User-Defined Type |
|
|
157 | (60) |
|
Null Value Implementation |
|
|
160 | (1) |
|
|
160 | (5) |
|
|
165 | (2) |
|
IBinarySerialize. Read/Write |
|
|
167 | (3) |
|
Creating User-Defined Types |
|
|
170 | (3) |
|
Public Properties, Fields, and Methods |
|
|
173 | (8) |
|
|
181 | (2) |
|
User-Defined-Type Validation |
|
|
183 | (2) |
|
Maintaining User-Defined-Type Definitions |
|
|
185 | (2) |
|
User-Defined Types and XML |
|
|
187 | (6) |
|
Should Objects Be Represented by User-Defined Types? |
|
|
193 | (14) |
|
|
207 | (2) |
|
Implementing a User-Defined Aggregate |
|
|
209 | (5) |
|
Creating User-Defined Aggregate |
|
|
214 | (1) |
|
Format.Native vs. Format.UserDefined |
|
|
215 | (2) |
|
|
217 | (2) |
|
|
219 | (58) |
|
New Security Features in SQL Server 2005 |
|
|
219 | (2) |
|
Optional Features Are Turned Off by Default |
|
|
221 | (3) |
|
Configuring Security Settings |
|
|
221 | (2) |
|
|
223 | (1) |
|
A Quick Review of SQL Server Security Concepts with Enhancements |
|
|
224 | (11) |
|
Authentication and Authorization: Principals and Permissions |
|
|
224 | (8) |
|
Execution Context and Ownership Chaining |
|
|
232 | (3) |
|
SQL Server Password Policies and Credentials |
|
|
235 | (3) |
|
Encryption Keys and Built-in Encryption Functions |
|
|
238 | (4) |
|
|
242 | (6) |
|
Separation of Users and Schemas |
|
|
248 | (4) |
|
|
252 | (1) |
|
Specifying Execution Context for Procedural Code |
|
|
253 | (6) |
|
|
259 | (2) |
|
SQL Server Permissions and SQLCLR Objects |
|
|
261 | (1) |
|
Assembly Permissions: Who Can Catalog and Use an Assembly? |
|
|
262 | (6) |
|
What .NET Framework Code Can Do from within SQL Server: Safety Levels |
|
|
268 | (7) |
|
Introduction to Code Access Security |
|
|
269 | (1) |
|
Code Access Security and .NET Framework Assemblies |
|
|
270 | (5) |
|
|
275 | (2) |
|
|
277 | (34) |
|
Improvements to the SQL Engine |
|
|
277 | (1) |
|
|
278 | (11) |
|
|
286 | (2) |
|
|
288 | (1) |
|
Data Definition Language Triggers |
|
|
289 | (5) |
|
|
294 | (4) |
|
|
298 | (3) |
|
Loading Data with the New Bulk Provider |
|
|
301 | (1) |
|
Statement-Level Recompilation |
|
|
301 | (2) |
|
Query Hints, Plan Guides, and Plan Forcing |
|
|
303 | (6) |
|
|
309 | (2) |
|
T-SQL Language Enhancements |
|
|
311 | (72) |
|
Improvements to Transact-SQL |
|
|
311 | (1) |
|
|
312 | (14) |
|
|
326 | (3) |
|
|
329 | (4) |
|
|
333 | (3) |
|
|
336 | (4) |
|
|
340 | (3) |
|
|
343 | (8) |
|
|
351 | (8) |
|
Pivot and Unpivot Operators |
|
|
359 | (7) |
|
|
359 | (6) |
|
|
365 | (1) |
|
|
366 | (10) |
|
|
368 | (1) |
|
|
369 | (1) |
|
|
370 | (1) |
|
|
371 | (2) |
|
|
373 | (1) |
|
|
374 | (2) |
|
|
376 | (5) |
|
|
381 | (2) |
|
XML in the Database: The XML Data Type |
|
|
383 | (46) |
|
|
383 | (1) |
|
Using XML Data Type in Tables |
|
|
384 | (6) |
|
Using XML Data Variables and Parameters |
|
|
390 | (2) |
|
Typed and Untyped XML: Cataloguing and Using XML Schema Collections |
|
|
392 | (9) |
|
SQL Server XML Schema Collections |
|
|
394 | (1) |
|
|
395 | (2) |
|
Management of XML Schemas and Schema Collections |
|
|
397 | (3) |
|
Security for XML Schema Collections and Strongly Typed Instances |
|
|
400 | (1) |
|
Creating an Index on an XML Column |
|
|
401 | (1) |
|
|
402 | (1) |
|
Select . . . For XML Enhancements |
|
|
403 | (11) |
|
|
406 | (1) |
|
Producing an XML Data Type |
|
|
407 | (2) |
|
Producing an Inline XSD Format Schema |
|
|
409 | (2) |
|
|
411 | (1) |
|
|
412 | (1) |
|
|
413 | (1) |
|
Mapping SQL and XML Data Types |
|
|
414 | (4) |
|
Mapping SQL Types to XML Types |
|
|
415 | (1) |
|
String, Binary, and Decimal Types |
|
|
415 | (1) |
|
|
416 | (1) |
|
|
417 | (1) |
|
|
417 | (1) |
|
|
418 | (1) |
|
|
418 | (1) |
|
|
418 | (2) |
|
Loading XML into the Database from Files |
|
|
420 | (2) |
|
ANSI SQL Standard Compliance |
|
|
422 | (4) |
|
|
422 | (2) |
|
Mapping SQL Catalogs and Tables to XML |
|
|
424 | (1) |
|
Mapping SQL Data Types to XML Data Types |
|
|
425 | (1) |
|
|
426 | (3) |
|
XML Query Languages: XQuery and XPath |
|
|
429 | (52) |
|
|
429 | (2) |
|
An Introduction to XQuery |
|
|
431 | (15) |
|
|
436 | (1) |
|
|
437 | (9) |
|
Comparing and Contrasting XQuery and SQL |
|
|
446 | (3) |
|
Using XQuery with the XML Data Type |
|
|
449 | (14) |
|
xml.exist(string xquery-text) |
|
|
450 | (2) |
|
xml.value(string xquery-text, string SQLType) |
|
|
452 | (2) |
|
xml.query(string xquery-text) |
|
|
454 | (3) |
|
xml.nodes(string xquery-text) |
|
|
457 | (4) |
|
XQuery Standard Functions and Operators |
|
|
461 | (2) |
|
SQL Server XQuery Functions and Operators |
|
|
463 | (1) |
|
XQuery Functions Supported by SQL Server |
|
|
463 | (1) |
|
XQuery Operators Supported by SQL Server |
|
|
464 | (4) |
|
SQL Server XQuery Extended Functions |
|
|
465 | (3) |
|
Multiple-Document Query in SQL Server XQuery |
|
|
468 | (1) |
|
XML DML: Updating XML Columns |
|
|
468 | (7) |
|
xml.modify('insert . . .') |
|
|
470 | (3) |
|
xml.modify('delete . . .') |
|
|
473 | (1) |
|
xml.modify('replace value of . . .') |
|
|
474 | (1) |
|
General Conclusions and Best Practices |
|
|
474 | (1) |
|
Special Considerations When Using XQuery Inside SQL Server |
|
|
475 | (5) |
|
XML Schemas and SQL Server 2005 XQuery |
|
|
475 | (2) |
|
XML Indexes Usage in XQuery |
|
|
477 | (3) |
|
|
480 | (1) |
|
SQL Server Service Broker |
|
|
481 | (80) |
|
|
481 | (13) |
|
|
494 | (5) |
|
|
499 | (60) |
|
|
503 | (6) |
|
|
509 | (7) |
|
|
516 | (8) |
|
|
524 | (4) |
|
|
528 | (2) |
|
|
530 | (4) |
|
|
534 | (6) |
|
|
540 | (1) |
|
|
541 | (3) |
|
|
544 | (15) |
|
|
559 | (2) |
|
SQL Server As a Platform for Web Services |
|
|
561 | (80) |
|
Mixing Databases and Web Services |
|
|
561 | (79) |
|
HTTP Endpoint Declaration |
|
|
564 | (5) |
|
|
569 | (1) |
|
|
570 | (1) |
|
|
571 | (1) |
|
|
572 | (1) |
|
|
573 | (5) |
|
WSDL Web Service Definition Language |
|
|
578 | (26) |
|
|
604 | (1) |
|
|
605 | (9) |
|
Stored Procedure in Web Service |
|
|
614 | (8) |
|
|
622 | (4) |
|
|
626 | (1) |
|
SQLXML 4.0 Functionality and SQL Server 2005 |
|
|
627 | (13) |
|
|
640 | (1) |
|
SQL Server 2005 and Clients |
|
|
641 | (64) |
|
|
641 | (4) |
|
New Data Types and Data Type Compatibility Mode |
|
|
645 | (1) |
|
User-Defined Types and Relational Data Access APIs |
|
|
646 | (1) |
|
Using .NET Framework UDTs in ADO.NET |
|
|
647 | (1) |
|
Fetching UDT Data from a DataReader |
|
|
648 | (6) |
|
Using .NET Framework UDTs in ODBC, OLE DB, and ADO Clients |
|
|
654 | (3) |
|
Supporting the XML Data Type on the Client |
|
|
657 | (10) |
|
Using the XML Data Type in ADO.NET |
|
|
657 | (2) |
|
Getting the XML As XML or a String |
|
|
659 | (2) |
|
Documents, Fragments, and For XML Support |
|
|
661 | (3) |
|
Using the XML Data Type in ADO Classic |
|
|
664 | (3) |
|
Supporting the Large Value Data Types on the Client |
|
|
667 | (3) |
|
Query Notification Support |
|
|
670 | (19) |
|
Query Notifications in SQL Server 2005 |
|
|
673 | (3) |
|
Using Query Notifications in OLE DB and ODBC |
|
|
676 | (1) |
|
Dispatching a Notification to an End User or Cache |
|
|
677 | (2) |
|
Using Query Notifications from a Database Client |
|
|
679 | (1) |
|
|
680 | (2) |
|
Using SqlNotificationRequest |
|
|
682 | (3) |
|
Using SqlCacheDependency in ASP.NET |
|
|
685 | (2) |
|
|
687 | (1) |
|
When Not to Use Notifications |
|
|
688 | (1) |
|
Multiple Active Resultsets |
|
|
689 | (6) |
|
Using Mars in ADO.NET 2.0 |
|
|
691 | (4) |
|
Mars in SQL Native Client |
|
|
695 | (1) |
|
New Transaction and Isolation Features in ADO.NET |
|
|
695 | (4) |
|
Using the New Isolation Levels |
|
|
695 | (2) |
|
Promotable and Declarative Transactions |
|
|
697 | (2) |
|
Changes Related to SQL Server 2005 Login |
|
|
699 | (4) |
|
|
699 | (2) |
|
|
701 | (1) |
|
|
702 | (1) |
|
Comparing the Client and Server Model for Stored Procedures |
|
|
703 | (1) |
|
|
704 | (1) |
|
ADO.NET 2.0 and SqlClient |
|
|
705 | (56) |
|
Generic Coding with the ADO.NET 2.0 Base Classes and Factories |
|
|
705 | (4) |
|
|
709 | (3) |
|
Specifying Configuration Information |
|
|
712 | (2) |
|
Enumerating Data Sources and Building Connection Strings |
|
|
714 | (3) |
|
Other Generic Coding Considerations |
|
|
717 | (2) |
|
|
719 | (12) |
|
Who Needs Metadata, Anyway? |
|
|
720 | (1) |
|
What Metadata Is Available? |
|
|
721 | (5) |
|
Customizing and Extending the Metadata |
|
|
726 | (3) |
|
|
729 | (2) |
|
|
731 | (12) |
|
|
732 | (1) |
|
|
733 | (1) |
|
Harvest the Results As a CSV File |
|
|
734 | (1) |
|
|
735 | (1) |
|
User Data and ADO.NET Tracing |
|
|
736 | (1) |
|
Configuring Which Applications Are Traced |
|
|
736 | (4) |
|
Using Tracing to Debug a Parameter Binding Problem |
|
|
740 | (2) |
|
|
742 | (1) |
|
|
742 | (1) |
|
|
743 | (6) |
|
|
749 | (3) |
|
|
752 | (1) |
|
.NET Framework DataSet and SqlDataAdapter Enhancements |
|
|
753 | (5) |
|
|
758 | (3) |
|
SQL Server Management Objects |
|
|
761 | (58) |
|
|
761 | (8) |
|
|
764 | (3) |
|
|
767 | (2) |
|
|
769 | (3) |
|
|
772 | (6) |
|
|
778 | (9) |
|
Default Windows Credentials Connection |
|
|
778 | (2) |
|
|
780 | (1) |
|
|
780 | (2) |
|
Windows Identity Impersonation |
|
|
782 | (1) |
|
|
783 | (1) |
|
Changing SQL Server Login Password |
|
|
784 | (1) |
|
|
785 | (2) |
|
|
787 | (3) |
|
|
790 | (12) |
|
|
790 | (3) |
|
|
793 | (1) |
|
URN Retrieval Restriction |
|
|
794 | (1) |
|
|
795 | (1) |
|
|
796 | (4) |
|
|
800 | (2) |
|
|
802 | (1) |
|
|
802 | (5) |
|
|
807 | (8) |
|
|
815 | (3) |
|
|
818 | (1) |
|
|
819 | (60) |
|
What Is SQL Server Notification Services? |
|
|
819 | (2) |
|
Notification Applications |
|
|
821 | (3) |
|
Components of SQL Server Notification Services |
|
|
824 | (4) |
|
Notification Applications Design Patterns |
|
|
828 | (1) |
|
Notification Services Delivery Features |
|
|
829 | (1) |
|
Terms Used in Notification Services |
|
|
829 | (2) |
|
Designing, Coding, and Generating a Notification Services Application |
|
|
831 | (2) |
|
|
831 | (1) |
|
|
832 | (1) |
|
Application Generation Steps |
|
|
833 | (1) |
|
A Sample Notification Application |
|
|
833 | (1) |
|
Instance and Application Configuration Files |
|
|
834 | (12) |
|
Instance Configuration File |
|
|
835 | (4) |
|
Application Definition File |
|
|
839 | (4) |
|
|
843 | (3) |
|
|
846 | (12) |
|
|
846 | (4) |
|
|
850 | (2) |
|
|
852 | (5) |
|
|
857 | (1) |
|
Subscribers and Subscriptions |
|
|
858 | (9) |
|
|
860 | (2) |
|
|
862 | (3) |
|
|
865 | (2) |
|
|
867 | (4) |
|
Distributor and Formatters |
|
|
871 | (2) |
|
|
873 | (5) |
|
|
874 | (3) |
|
|
877 | (1) |
|
|
878 | (1) |
|
Wrap-Up: Service-Oriented Database Applications |
|
|
879 | (18) |
|
Lots of New Features: How to Use Them |
|
|
879 | (1) |
|
Data Models, Programming, and SQL Server |
|
|
880 | (1) |
|
Any Functionality at Any Tier |
|
|
881 | (1) |
|
What Are the Best Practices? |
|
|
882 | (9) |
|
Toward a Service-Oriented Database Architecture |
|
|
891 | (3) |
|
The Database As Part of the Platform |
|
|
894 | (3) |
|
|
|
|
897 | (26) |
|
The Common Language Runtime |
|
|
897 | (4) |
|
|
899 | (2) |
|
|
901 | (4) |
|
|
901 | (2) |
|
|
903 | (1) |
|
Assembly Names and Versions |
|
|
904 | (1) |
|
|
905 | (9) |
|
|
907 | (1) |
|
|
908 | (2) |
|
|
910 | (2) |
|
|
912 | (2) |
|
|
914 | (4) |
|
|
916 | (1) |
|
|
917 | (1) |
|
|
918 | (5) |
|
Finalization and Destructors |
|
|
919 | (1) |
|
|
920 | (3) |
|
B. SQL Server Management Studio |
|
|
923 | (26) |
|
|
923 | (1) |
|
|
924 | (13) |
|
|
925 | (2) |
|
Making a Solution/Project |
|
|
927 | (10) |
|
|
937 | (7) |
|
|
944 | (5) |
|
C. Visual Studio 2005 Integration: SQL Server Projects |
|
|
949 | (14) |
|
|
949 | (14) |
|
Custom Attributes and Automatic Deployment |
|
|
955 | (1) |
|
|
956 | (2) |
|
|
958 | (1) |
|
Executing and Debugging the Code |
|
|
959 | (4) |
References |
|
963 | (2) |
Index |
|
965 | |