Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way (registry hack is acceptable) to remove options from the context menus in SSMS?

Specifically I'd like to remove the delete option from the context menu when you right click on a merge replication publication. If we really want it deleted we'll do it via tsql.

And yes, there is a tragic tale motivating this question.

share|improve this question
up vote 3 down vote accepted

I suspect the "tragic tale" might be that someone who had sysadmin privileges (but shouldn't have) went in and deleted one of these things (possibly by mistake).

But another thought occurred to me: someone who should have sysadmin privileges might have done the same thing (by mistake).

In lieu of being able to cripple Management Studio (which I suppose you could do by writing your own an add-in), you should consider simply not logging in as sysadmin except when absolutely necessary.

At my old job we tried to implement a policy where by default you connect to SQL Server as you, and you are given the rights you should have for most tasks. When you need to escalate to do something out of the ordinary, only then do you connect as sysadmin. This worked with some success - however you need to be tolerant of the moaning and griping that will happen. We actually had different database roles such as a read only for our QA department - allowing them, say, to validate a report output by selecting from certain tables directly.

share|improve this answer
This is a case where the rights are granted, and must remain due to the fact that its a single tech at a remote center. A do-it-all guy for the operation. We follow your model here at our main office. For example my network login does little, I have another login with .sup on the end that does more. We have a third login that does it all. But in this case - our choices are limited as he regularly needs to do maintenance on the subscriptions (including deleting old adding new). The publication was killed on accident however and that's what I'd like to avoid again. – RThomas May 18 '12 at 19:39
+1 for the empathy :) – RThomas May 18 '12 at 19:42
Create stored procedures that wrap the activities he's allowed to do (just about anything you can do through the UI can be scripted), and force him to use the stored procedures instead of the UI. I have a ruler you can borrow for his knuckles if he doesn't comply. – Aaron Bertrand May 18 '12 at 19:42

SSMS is simply a GUI to work with SQL Server. No, I don't think you can change these things for SSMS.

The real right answer is to use permissions within SQL Server to allow/deny certain principals from doing what your tragic tale is about.

share|improve this answer
Agreed. This is one of the perils of just giving sysadmin to everyone who asks... – Aaron Bertrand May 18 '12 at 19:31
I also agree with your answer... but in this case the rights are part of the job description, we're just brainstorming in a after action mindset here. – RThomas May 18 '12 at 19:45
@RThomas I read your comment on Aaron's answer, and all I can say heart goes out to you. :) – Thomas Stringer May 18 '12 at 19:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.