How can we help you today? How can we help you today?

Invoke-DatabaseBuild - Post build: ALTER DATABASE SET SINGLE_USER statement failing on Azure SQL MI

Hello,

We are migrating to Azure SQL Managed Instance for all of our databases. We have found that the Invoke-DatabaseBuild is failing after the schema validation build step is done. It appears Invoke-DatabaseBuild attempts to set the database to single user mode before attempting to drop it. This is an invalid ALTER DATABASE command for Azure SQL Managed Instance. I could not immediately find a flag to skip setting single user mode.

We used sql profiler to identity the sql statements below.
ALTER DATABASE [sql_change_automation_f3a96260-d563-4bff-9153-c05f744974b7] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE [sql_change_automation_f3a96260-d563-4bff-9153-c05f744974b7];


wstyp
0

Comments

1 comment

Add comment

Please sign in to leave a comment.