ODBC Samples

The samples in this section demonstrate how to use ODBC to retrieve data.

In This Section

  • Readme_Logging Long-Running Queries (ODBC)
    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.
  • Readme_How to process ODBC errors (ODBC)
    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 SQL Server ODBC driver-specific diagnostic fields.
  • Readme_ODBC Date Time
    Shows how to initialize the date/time data structures that were added in SQL Server 2008. The sample then prepares the input values, binds parameters, and executes the query.
  • Readme_Spatial_Storage
    This sample shows how to insert two rows into a table with a geography column from a WellKnownBinary (WKB) using 2 different bindings, and then selects one row from that table and uses ::STAsText() to display it.

See Also

Concepts

Data Access Samples

Other Resources

SQL Server 2008 Native Client (ODBC)

Help and Information

Getting SQL Server 2008 Assistance