SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Error trying to alter procedure on replication publisher


Error trying to alter procedure on replication publisher

Author
Message
JimBama08
JimBama08
SSC Rookie
SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)

Group: General Forum Members
Points: 44 Visits: 195
I have two SQL Server 2005 Standard Edition servers in my development environment that are configured for both Merge and Transactional replication. Server A is the publisher for both, Server B is the subscriber for transactional and a merge participant. One of our developers is trying to update a stored procedure on the publisher and fails with this error:
Msg 21050, Level 16, State 1, Procedure sp_MSmerge_ddldispatcher, Line 12
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

The developer is a member of db_ddladmin, db_datareader/writer, db_securityadmin, db_accessadmin in the publication database, but is NOT a member of db_owner by design/policy. I have turned off the "Replicate schema changes" option in Subscription Options for both publications, as it appeared in BOL as though any ALTER PROCEDURE statement is replicated when that option is turned on. (We do not replicate any stored procedures in either publication.) Unfortunately, the developer continues to receive this error message.

Is this a Microsoft bug? Is my only recourse (other than executing all SP changes myself) to make developers DBO?

- Jim

~~ Everything in moderation, including moderation. ~~
JimBama08
JimBama08
SSC Rookie
SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)

Group: General Forum Members
Points: 44 Visits: 195
Turns out I may have found the answer, unseemly as it may be. The error message appears to be bogus. The developer went back and checked the stored procedure and it had been updated, despite the error message.

~~ Everything in moderation, including moderation. ~~
italorabello
italorabello
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 11
updates, but the change is not replicated to another server. I'm having the same problem.
Animal Magic
Animal Magic
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1590 Visits: 13731
Did any of you ever get a resolution to this problem?
Animal Magic
Animal Magic
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1590 Visits: 13731
It seems this is a sql design "issue". Once a database is marked for replication ALL objects - whether or not they are replicated - call the sp_MSmerge_ddldispatcher procedure. This SP has an is_member('db_owner') check at the start so it fails if your not. There is a brief discussion on it here...

http://www.sqldev.org/sql-server-replication/issue-with-modifying-sps-after-replicating-a-database-in-sql-server-2005-71178.shtml

So it seems there are 2 options

1) You dont give your devs alter permissions in live (probably already in place in larger corps)
2) You let the devs know that the SP will amend but if its replicated then the schema change wont replicate

I'm just going to go with option2 for now as we only replicate tables
Jatin Soni
Jatin Soni
Valued Member
Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)

Group: General Forum Members
Points: 56 Visits: 373
Hello,
I am having the same problem. I had given developers DDL_Admin rights and it was working fine. I just need to setup merge replication for few tables and transactional for other tables. however developer started complaining that they are getting following error while altering procedure (although procedures are getting altered)

Msg 21050, Level 16, State 1, Procedure sp_MSmerge_ddldispatcher, Line 12
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.

I am not replicating any procedures. I am only replicating few tables.
Not sure why above procedure gets executed and why it needs to check owner.

can someone let me know how to resolve this issue? I do not wish to grant developers more rights.

Jatin Soni
Jatin Soni
Jatin Soni
Valued Member
Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)

Group: General Forum Members
Points: 56 Visits: 373
Found the way to get rid of above error. I am posting solution here so that it will help others who are facing same issues. See the script I have created below.

/*Jatin: following trigger is enabled when replication is setup/altered
If it is Enabled then SQL developer will get following error while they try to
Alter any Procedure in database which is in replication.

Msg 21050, Level 16, State 1, Procedure sp_MSmerge_ddldispatcher, Line 12
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.

Resolution: Disable this database trigger. Since we are not replicating any procedure or functions,
it will not harm if this trigger do not fire.

*/

IF EXISTS (SELECT is_disabled,* FROM sys.triggers
WHERE parent_class_desc = 'DATABASE'
AND name = N'MSmerge_tr_alterschemaonly'
and is_disabled =0 --0 means DB Trigger is ENABLED
)
Begin
DISABLE TRIGGER [MSmerge_tr_alterschemaonly] ON DATABASE

End
Logan Galler-357671
Logan Galler-357671
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 651
I just ran into this with a snapshot replication and a dynamic alter view and had to DISABLE TRIGGER [tr_MStran_alterview] ON DATABASE. I am sure there is a way to grant the proper rights to the underlying triggers. In this case views were not getting replicated so it was ok.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search