Sparse Columns Support (ODBC)

Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW)

Important

The SQL Server Native Client (often abbreviated SNAC) has been removed from SQL Server 2022 (16.x) and SQL Server Management Studio 19 (SSMS). The SQL Server Native Client (SQLNCLI or SQLNCLI11) and the legacy Microsoft OLE DB Provider for SQL Server (SQLOLEDB) are not recommended for new application development. Switch to the new Microsoft OLE DB Driver (MSOLEDBSQL) for SQL Server or the latest Microsoft ODBC Driver for SQL Server going forward. For SQLNCLI that ships as a component of SQL Server Database Engine (versions 2012 through 2019), see this Support Lifecycle exception.

This topic describes SQL Server Native Client ODBC support for sparse columns. For a sample demonstrating ODBC support for sparse columns, see Call SQLColumns on a Table with Sparse Columns. For more information about sparse columns, see Sparse Columns Support in SQL Server Native Client.

Statement Metadata

The application parameter descriptor (APD) descriptor field and SQL_SOPT_SS_NAME_SCOPE statement attribute accepts the additional values SQL_SS_NAME_SCOPE_EXTENDED and SQL_SS_NAME_SCOPE_SPARSE_COLUMN_SET. These values specify which columns are included in the result set returned by SQLColumns. For more information about SQL_SOPT_SS_NAME_SCOPE, see SQLSetStmtAttr.

A new implementation row descriptor (IRD), a read-only SQLSMALLINT field called SQL_CA_SS_IS_COLUMN_SET, can be used to determine if a column is an XML column_set value. SQL_CA_SS_IS_COLUMN_SET takes the values SQL_TRUE and SQL_FALSE.

Catalog Metadata

Two SQL Server specific columns (SS_IS_SPARSE and SS_IS_COLUMN_SET) have been added to the result set for SQLColumns.

ODBC Function Support for Sparse Columns

The following ODBC functions have been updated to support sparse columns in SQL Server Native Client:

See Also

SQL Server Native Client (ODBC)