Data Access

30.7 Data Access

SQL S erver supports the following application programming interfaces ( API s) for building data-intensive applications:

1 The Sarbanes-Oxley Act is a U.S. government financial regulation law. HIPAA is a U.S. government health-care law that includes regulation of health-care-related information.

2 Fuzz testing A randomization-based technique for testing for unexpected, possibly invalid, input.

30.7 Data Access 1249

• ODBC . This is Microsoft’s implementation of the standard SQL:1999 call-

level interface ( CLI ). It includes object models—Remote Data Objects ( RDO s) and Data Access Objects ( DAO s)—that make it easier to program multitier database applications from programming languages like Visual Basic.

• OLE-DB . This is a low-level, systems-oriented API designed for programmers

building database components. The interface is architected according to the Microsoft Component Object Model ( COM ), and it enables the encapsulation of low-level database services such as rowset providers, ISAM providers, and query engines. OLE-DB is used inside SQL S erver to integrate the relational query processor and the storage engine and to enable replication and dis- tributed access to SQL and other external data sources. Like ODBC , OLE-DB includes a higher-level object model called ActiveX Data Objects ( ADO ) to make it easier to program database applications from Visual Basic.

• ADO.NET . This is an API designed for applications written in .NET languages

such as C# and Visual Basic. NET . This interface simplifies some common data access patterns supported by ODBC and OLE-DB . In addition, it provides a new data set model to enable stateless, disconnected data access applications. ADO.NET includes the ADO.NET Entity Framework , which is a platform for programming against data that raises the level of abstraction from the logical (relational) level to the conceptual (entity) level, and thereby significantly reduces the impedance mismatch for applications and data services such as reporting, analysis, and replication. The conceptual data model is imple- mented using an extended relational model, the Entity Data Model ( EDM ) that embraces entities and relationships as first-class concepts. It includes a query language for the EDM called Entity SQL , a comprehensive mapping engine that translates from the conceptual to the logical (relational) level, and

a set of model-driven tools that help developers define mappings between objects and entities to tables.

• LINQ . Language-integrated query , or LINQ for short, allows declarative, set-

oriented constructs to be used directly in programming languages such as C# and Visual Basic. The query expressions are not processed by an external tool or language preprocessor but instead are first-class expressions of the languages themselves. LINQ allows query expressions to benefit from the rich metadata, compile-time syntax checking, static typing and auto-completion that was previously available only to imperative code. LINQ defines a set of general-purpose standard query operators that allow traversal, filter, join, projection, sorting, and grouping operations to be expressed in a direct yet declarative way in any .NET -based programming language. C# and Visual Basic also support query comprehensions, i.e., language syntax extensions that leverage the standard query operators.

• DB -Lib . The DB -Library for C API that was developed specifically to be used

with earlier versions of SQL S erver that predate the SQL-92 standard. • HTTP/SOAP . Applications can use HTTP/SOAP requests to invoke SQL S erver

queries and procedures. Applications can use URL s that specify Internet In-

1250 Chapter 30 Microsoft SQL Server

formation Server ( IIS ) virtual roots that reference an instance of SQL S erver. The URL can contain an XP ath query, a Transact- SQL statement, or an XML template.