Recently I had this error in my Spring Boot application,  during the connection to MSSQL Server:

ERROR org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentImpl - Could not fetch the SequenceInformation from the database
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'INFORMATION_SCHEMA.SEQUENCES'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) ~[sqljdbc4-4.0.jar:?]
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) ~[sqljdbc4-4.0.jar:?]
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792) ~[sqljdbc4-4.0.jar:?]
.....

After the investigation, I discovered that I had two issues in my configuration that caused this behavior.

My previous configuration in the application.properties was:

spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect

What I found out is that I'm setting the wrong property, the right one should be:

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect

I also used this query to check the version of my SQL Server, and it turned out that I'm connecting to version 2008 instead of 2012. So, in the end, my connection dialect property was:

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServer2008Dialect

After I changed this, everything worked like a charm.

Pin It