com.microsoft.sqlserver.jdbc.SQLServerException: USE statement is not supported to switch between databases. Use a new connection to connect to a different database
when I looked for this error . This seems that azure sql database does not support USE statement if we try to switch between different databases .
I will be following up with azure support team for this .
But my question is why it is trying to switch to different database . When I have already provided the database name in the connectionstring.
Have any body worked on connecting with azure sql database or azure sql warehouse .
I’m sorry I don’t have an exact answer to fix your issue, but I think that we currently encourage fully qualified table names in our queries, so calling USE {database} at the top of Achilles should not be necessary. So possibly the fix is to alter the Achilles scripts to remove the USE statements from the script.
The problem is that if you specify schema in your connectionDetails, the connect() function will automatically issue a USE statement after connecting to switch to the schema you specified.
The solution should therefore be to not specify the schema argument.
Thanks for your reply . I had tried with not using schema name in connection details.But error was the same . What I did was wherever it was asking for schema name I user dbname.schemaname.Now connection with database is working