Underscore in table name gives "Table not found" log

Description

When I deploy my application in WildFly, I get a bunch of log statements from hibernate for tables with underscore in the name:

2016-05-03 11:39:25,344 INFO [org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl] (ServerService Thread Pool – 61) HHH000262: Table not found: AAA_BBB

I've investigated a bit and found that it is due to the usage of sp_tables. This (which is what Hibernate uses) does not work:

exec sp_tables N'AAA_BBB',N'',N'MyDb',N'''''''TABLE'''',''''VIEW''''''', @fUsePattern = 1

This however, works:

exec sp_tables N'AAA_BBB',N'',N'MyDB',N'''''''TABLE'''',''''VIEW''''''', @fUsePattern = 0

Environment

WildFly 10.0.0.Final
Microsoft SQL Server 2012

Assignee

Unassigned

Reporter

JacobC

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure