OLE DB Samples
The samples in this section demonstrate how to use OLE DB to retrieve data.
SQL Server samples and sample databases must be downloaded and installed before you can view or work with them. For more information, see Considerations for Installing SQL Server Samples and Sample Databases.
In This Section
- Readme_User-Defined Function Sample (OLE DB)
Executes a user-defined function and prints a return code.
- Readme_Stored Procedure Using RPC Syntax (OLE DB)
Demonstrates processing a rowset, a return code, and an output parameter.
- Readme_Fetching Rows from a Result Set (OLE DB)
Shows how to fetch rows from a result set.
- Readme_Fetching Columns Using IRow::GetColumns (OLE DB)
Shows how to fetch a single row using IRow.
- Readme_Fetching Columns Using IRow::GetColumns/IRow::Open and ISequentialStream (OLE DB)
Shows how to fetch a single row using IRow.
- Readme_Setting Large Data (OLE DB)
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.
- Readme_Enumerating OLE DB Data Sources
Shows how to use the enumerator object to list the data sources available.
- Readme_Bulk Copy Using IRowsetFastLoad (OLE DB)
Illustrates the use of IRowsetFastLoad for bulk copying of the records into a table.
- Readme_Retrieving Rows Using Bookmarks (OLE DB)
Shows how to fetch rows using a bookmark.
- Readme_Reading a FILESTREAM Column to File Using IBCPSession (OLE DB)
Reads a FILESTREAM column to a file using the IBCPSession interface and writes a format file.
- Readme_Retrieving Data from a FILESTREAM Column Using ISequentialStream (OLE DB)
Shows how to use an ISequentialStream interface in an ICommandText interface to retrieve data from a Filestream column.
- Readme_Sending Data to a FILESTREAM Column Using ISequentialStream Bound to ICommandText Parameter (OLE DB)
Uses an ISequentialStream bound to a ICommandText parameter to send up to 4GB of data to a filestream column.
- Readme_Sending Data to a FILESTREAM Column Using IRowsetFastUpload (OLE DB)
Uses the IRowsetFastUpload interface to send between 4MB and 4GB of data to a filestream column.
- Readme_Enhanced Date/Time Features Sample (OLE DB)
Shows how to use the date/time features in OLE DB introduced in SQL Server 2008. The sample uses the four new date and time types (date, time, datetim2, and datetimeoffset) to execute commands with parameters and retrieve rowset results.
- Readme_Changing a SQL Server Authentication User Password (OLE DB)
Shows how to use OLE DB to change the password of a SQL Server Authentication user account.
- Readme_Integrated Kerberos Authentication Sample (OLE DB)
Shows how to get mutual Kerberos authenication by using OLE DB in SQL Server Native Client.
- Readme_Displaying Column and Catalog Metadata for Sparse Columns (OLE DB)
Shows how display column and catalog metadata for sparse columns in a table.
- Readme_Obtaining a FAST_FORWARD Cursor (OLE DB)
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.
- Readme_Table-Valued Parameters
Demonstrates the pull method for table-valued parameters.
- Readme_Sending BLOB Data to SQL SERVER Using IROWSETFASTLOAD and ISEQUENTIALSTREAM
Shows how to use IRowsetFastLoad to stream varying length BLOB data per row.
- Readme_Large_UDT_OLEDB
Shows how to access data from a CLR user-defined type.
See Also
Concepts
Other Resources
SQL Server 2008 Native Client (OLE DB)