Alter Database within a migration?

292 views
Skip to first unread message

Jeff Dege

unread,
Jul 31, 2015, 1:02:04 PM7/31/15
to FluentMigrator Google Group
We have a database that we're creating and managing with FluentMigrator.

Now we have a need to do an alter database on it:

ALTER DATABASE CURRENT SET ENABLE_BROKER

We're going to have some tables watched using Sql Dependency, and that requires that this flag be set on the database.

Trying to run this in a migration throws an exception:

System.Data.SqlClient.SqlException: ALTER DATABASE statement not allowed within multi-statement transaction.

Is there a way to run an ALTER DATABASE statement from within a migration?


Gunnar Liljas

unread,
Jul 31, 2015, 5:38:03 PM7/31/15
to fluentmigrato...@googlegroups.com
Spin up a new connection inside the migration and execute it "manually"?


Sent from Mailbox


--
You received this message because you are subscribed to the Google Groups "FluentMigrator Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentmigrator-goog...@googlegroups.com.
To post to this group, send email to fluentmigrato...@googlegroups.com.
Visit this group at http://groups.google.com/group/fluentmigrator-google-group.
For more options, visit https://groups.google.com/d/optout.

Tom Marien

unread,
Jul 31, 2015, 5:52:12 PM7/31/15
to fluentmigrato...@googlegroups.com
Run migration without transaction look in tag if migration attrib. ;)

Verstuurd vanaf mijn iPhone
Reply all
Reply to author
Forward
0 new messages