Data Access Samples
The data access samples demonstrate how to use various features of SQL Server 2005 when retrieving data.
To be able to view or work with these samples, make sure they have been installed. For more information, see Installing Samples.
Name | Description |
---|---|
Demonstrates how to use the Multiple Active Result Set (MARS) feature. |
|
Demonstrates how to retrieve binary data stored in the database and write the contents to a file. |
|
Demonstrates processing a rowset, a return code, and an output parameter. |
|
Demonstrates processing a rowset, a return code, and an output parameter. |
|
README Execute user-defined function and process return code (OLE DB) |
Executes a user-defined function and prints a return code. |
Shows how to fetch rows from a result set. |
|
Shows how to set BLOB data, create a table, add a sample record, fetches that record in the rowset, and then set the value of the BLOB field. |
|
Shows how to use the enumerator object to list the data sources available. |
|
Illustrates the use of IRowsetFastLoad for bulk copying of the records into a table. |
|
Shows how to set the rowset properties to obtain a FAST_FORWARD cursor. After the properties are set, a SELECT statement is executed to retrieve and display the Name column of the Purchasing.Vendor table in the AdventureWorks database. |
|
Shows how to fetch rows using a bookmark. |
|
README Fetching Columns Using IRow::GetColumns (or IRow::Open) and ISequentialStream |
Shows how to fetch a single row using IRow. |
Shows how to fetch a single row using IRow. |
|
README How to process return codes and output parameters (ODBC) |
Shows processing a return code and output parameter. |
Shows the SQL Server ODBC driver-specific options to record performance statistics. The sample creates one file: odbcperf.log. |
|
Shows the SQL Server ODBC driver-specific options to log long-running queries. When run, creates Odbcqry.log, which contains a list of queries whose execution exceeds an interval set by the application. |
|
Shows a simple error handler that calls SQLGetDiagRec for the standard ODBC information. It then tests for a valid connection, and if there is, it calls SQLGetDiagField for the Microsoft® SQL Server™ ODBC driver-specific diagnostic fields. |
|
Shows how to bulk code without a format file. |
|
Shows how to bulk copy and write the result set of a SELECT statement. |
|
This sample shows how to do a bulk copy from program variables bound with bcp_bind; data sent with bcp_sendrow. |
|
Shows how to create a bulk copy format file. |
|
Shows how to use the ODBC bcp_init function with a format file. |
|
Shows how to read a SQL_LONG variable character data using SQLGetData. |
|
Shows how to read a SQL_LONG variable character data using SQLGetData. |
|
Shows how database mirroring works. |
Important
These samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples.
See Also
Other Resources
Running Setup to Install AdventureWorks Sample Databases and Samples
Reinstalling Sample Databases from Script