The procedures 'sp_serveroption' and 'sp_droplinkedsrvlogin' cannot be executed within a transaction
Which version and edition of Flyway are you using?
flyway-maven-plugin:5.2.4
If this is not the latest version, can you reproduce the issue with the latest one as well?
(Many bugs are fixed in newer releases and upgrading will often resolve the issue)
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
maven
Which database are you using (type & version)?
SQLServer
Which operating system are you using?
Ubuntu
What did you do?
(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.) Executing SP_SERVEROPTION or SP_DROPLINKEDSRVLOGIN
Fix:- Add |(EXEC .*SP_SERVEROPTION) |(EXEC .*SP_DROPLINKEDSRVLOGIN) to the NON_TRANSACTIONAL_STATEMENT_REGEX in SQLServerSqlStatementBuilder.java
What did you expect to see?
[INFO] Executing SQL callback: beforeMigrate [non-transactional]
and BUILD SUCCESS
What did you see instead?
SQL State : S1000 Error Code : 15002 Messsage : The procedure 'sys.sp_serveroption' cannot be executed within a transaction.
and
Message : The procedure 'sys.sp_droplinkedsrvlogin' cannot be executed within a transaction.
Thanks for reporting and analyzing! Fixed.