Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Error trying to alter procedure on replication publisher Expand / Collapse
Author
Message
Posted Thursday, June 18, 2009 12:27 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, February 8, 2013 10:21 AM
Points: 22, 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. ~~
Post #737823
Posted Thursday, June 18, 2009 1:21 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, February 8, 2013 10:21 AM
Points: 22, 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. ~~
Post #737855
Posted Thursday, April 15, 2010 11:41 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, April 3, 2013 7:53 PM
Points: 1, Visits: 11
updates, but the change is not replicated to another server. I'm having the same problem.
Post #904256
Posted Friday, October 15, 2010 4:51 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 6:20 AM
Points: 1,001, Visits: 13,532
Did any of you ever get a resolution to this problem?
Post #1005047
Posted Friday, October 15, 2010 5:19 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 6:20 AM
Points: 1,001, Visits: 13,532
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
Post #1005057
Posted Thursday, January 20, 2011 9:17 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, October 16, 2014 3:20 AM
Points: 31, Visits: 310
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

Post #1050889
Posted Saturday, January 22, 2011 5:40 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, October 16, 2014 3:20 AM
Points: 31, Visits: 310
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
Post #1051946
Posted Tuesday, August 21, 2012 1:07 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, November 20, 2014 11:26 AM
Points: 1, Visits: 460
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.

Post #1348056
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse