I have a SQL Server user (call it usr_Publish) which is assigned to the db_ddladmin role. This user was used as part of an in-house built tool for publish SQL changes from subversioned SQL scripts into my business’ DB environments. Naturally, it required db_ddladmin level access to do things like create or drop tables, edit stored procedures, etc. Nothing fancy.
However, the SQL server instance for one of these DB environments was recently replicated between two separate instances for business reasons. Ever since this happened, when usr_Publish attempts to publish some changes to DB objects (specifically ALTER TABLE ADD [column]), it gets the following message:
Msg 21050, Level 14, State 1, Server msn1-win-504LUMSTG01, Procedure
sys.sp_MSreplcheck_publish, Line 16 Only members of the sysadmin fixed
server role or db_owner fixed database role can perform this
operation. Contact an administrator with sufficient permissions to
perform this operation.
My DBA temporarily granted usr_Publish sufficient (db_owner) rights to the relevant database to run the necessary ALTER TABLE commands for my current tasks, but we are trying to figure out how to setup access for usr_Publish for the future so that it can still do what db_ddladmin should be able to do, but without giving it full db_owner rights.
Can anyone help us try to thread the needle between the db_ddladmin access, which is no longer sufficient in our ‘replicated server’ situation, and the db_owner access which is too wide in scope?
NOTE: I am a software engineer experienced with SQL programming, not a DBA, so I’m phrasing this as correctly as I can. If there are questions about the replication setup, go ahead and ask and I will reply back as best I can after consulting with my DBA.