c# - Publish dacpac in single user mode using Microsoft.SqlServer.Dac.DacServices -
i want publish dac pac in single user mode prevent unnecessary db changes while database upgrading. have used deploy function in microsoft.sqlserver.dac.dacservices.
that function there argument dacdeployoptions options. have set deploydatabaseinsingleusermode = true
in options. though set true able db operation while dacpac deploying.
is there missing? or there other way achieve this.
help appreciated!
which version of dacfx using? if it's not latest, best latest, because lot of older ones not @ recognizing options specify.
alternatively, this(it's i've done, instead of trying dacfx work properly.
serverconnection connection = new serverconnection(servername); server sqlserver = new server(connection); database qadatabase = sqlserver.databases[databasename]; qadatabase.databaseoptions.useraccess = databaseuseraccess.single; qadatabase.alter(terminationclause.rollbacktransactionsimmediately); qadatabase.refresh(); //dacpac logic goes here qadatabase.databaseoptions.useraccess = databaseuseraccess.multiple; qadatabase.alter(terminationclause.rollbacktransactionsimmediately); qadatabase.refresh();
Comments
Post a Comment