On a computer that is running Windows Vista or Windows Server 2008, the SQLTables function of the Microsoft SQL Server ODBC drivers that are included in the operating system cannot handle the “%_%” pattern correctly. When you call the SQLTables ODBC catalog function by specifying “%_%” as the table name search pattern, the function does not return correct results when a table name includes an underscore character (_).
For example, you have a database that contains two tables. One of the tables is named “Frank”, and the other table is named “Fran_k”. You call the SQLTables function to query tables whose names end in “_k”. In this scenario, the results that are returned by the function represent both the “Frank” table and the “Fran_k” table. However, the results should represent only the “Fran_k” table.
- This issue occurs only when you use the SQL Server ODBC drivers that are included in Windows Vista and in Windows Server 2008.
- This issue does not occur when you use SQL Native Client or when you use the SQL Server ODBC drivers that are included in Windows XP and in Windows Server 2003.