Differentiating between environments within SQL Server Management Studio
secretGeek .:dot Nuts about dot Net:.
home .: about .: sign up .: sitemap .: secretGeek RSS

Differentiating between environments within SQL Server Management Studio

you are about to execute a DROP statement in production, OK or Cancel?

When you're looking at a query window that's connected to Production, it would be nice if it was visually distinct from a non-production environment.

For example, there could be a red theme applied to the window.

Furthermore, there could be a warning before a potentially destructive query is executed. (Essentially, any query that isn't just a select - for example, a drop, delete, update, insert, create or alter)

This would be an effective way to lower the chance of something being done to production that was intended for another environment (pre-prod say, or development)

I can imagine a straw-man counter-argument to this concept that says:

"The only people who should have access to production are people who know what they're doing"

Or alternatively,

"Developers shouldn't have access to production"

And that's fine by me.

We can limit who accesses production, and we can give minimum privileges to those that do have access.

But even then:

*Someone* will have destructive privileges in production.

And that person will definitely have access to more than one system.

And that person, no matter how smart or conscientious they are, will be fallible.

Hence, it's helpful for that person to be able to differentiate (visually) between the different environments.

Why am I writing this blog entry right now?

Don't worry. I stopped myself in time ;-)

(And like all blog posts everywhere, there is already a stackoverflow question that says the same thing and a whole lot more)





'Michael D. Hall' on Mon, 23 Mar 2009 13:50:26 GMT, sez:

As a counterpoint to your preemptive counterpoint, I'd like to point out that there are shops that have one or two developers that are also responsible for production. Just as a safe-guard for "those who know better" it could save their skin, more than once I was bouncing between dev and prod running queries trying to figure out some problem and accidentally ran a query in production that I *meant* to run on development. I'm bad. It could become the UAC of Sql development. :-(

Should I mark time spent on secretGeek as productive in TimeSnapper?



'Michael L Perry' on Mon, 23 Mar 2009 17:20:20 GMT, sez:

"Shit!!" should be the default, not "OK".



'Todd' on Mon, 23 Mar 2009 17:40:41 GMT, sez:

There is nothing wrong will allowing developers access to production, just make the separate tasks and make it more difficult to access that system so you can't do this accidentally. You can separate production into a different domain, or create a specific production login. Either way a developer's main login shouldn't be allowed to access production systems.

The unix crowd learned this long ago: create a separate user and administrator account. Your user account shouldn't be an administrator.



'Mladen' on Mon, 23 Mar 2009 17:59:37 GMT, sez:

Hi!

if you're looking for the bright red thinige for your production servers then you might want to check out www.ssmstoolspack.com
It's a free add-in for ssms that offers the functionality you wish.

i had the same problem as you. :))



'Wedge' on Mon, 23 Mar 2009 18:06:35 GMT, sez:

This is a good reason to use completely different db servers for testing and production. It makes these sorts of problems a fair bit more difficult.

Also, it's a shame that DBs aren't more like source control (with a change history and the ability to revert changes), even though they easily could be.



'lb' on Mon, 23 Mar 2009 19:02:17 GMT, sez:

@Mladen
>check out www.ssmstoolspack.com

Excellent work, Mladen. Just the thing!

It's got a tonne of nice features. Brilliant stuff.



'Tuftesque' on Mon, 23 Mar 2009 21:48:15 GMT, sez:

The use of <font color='red'> is very Tuftesque.



'Steven Nagy' on Tue, 24 Mar 2009 07:48:21 GMT, sez:

I really couldn't be assed (yes its a word) reading ALL the comments, so I'm just gonna make my view point, which by the way, is the correct view point.

First, as pointed out, this idea isn't new. Even now sys admins get a red font when they are running command prompt with their admin account.

The key point here is that there are 2 accounts. No one should ever accidentally do something in prod. Your developer account has read access to prod and write access locally. Then you have a developer admin account that has master privileges. This account usually has a password of length int.max for security. If you REALLY need to be doing something in prod, you use the special account. You only log in long enough to do your special work, then log out again.

This is how it should be done. The infrastructure world has had this nailed for years. You're not dumber than a sys admin are you Leon?



'Chad Miller' on Sun, 29 Mar 2009 13:14:37 GMT, sez:

In 2008 version of SQL Server Management Stduio you can color code your connection without any add-ins. The feature is natively part of the SSMS 2008. Go To Registered Servers >> Right-Click a server >> Connection Properties tab >> Select "Use Custom Color"

The feature is not natively available in SSMS 2005, however SSMS 2008 is backward compatible.



'rudyx' on Mon, 30 Mar 2009 16:09:12 GMT, sez:

I personally use different backgrounds for wondows via RDP:

light red - production
light yellow - test
light blue - development
light brown - sand boxes

I do wish SSMS could as well



'Jim Butts' on Mon, 06 Apr 2009 16:10:00 GMT, sez:

Steven Nagy Hit the nail on the head. There absolutely has to be account seperation. Color code whatever you like but make sure that the account for dev has no connection to the production account. A pint I'd like to add is that a common mistake is to give 1 "master" accout out. Each production account should be personal. I disagree with the idea that there is nothing wrong with developers geting access to production. Developers in particular should be exclusive to a dev or test environment. Allowing them access to production can quickly lead to an undocumented production environment as acess encourages both management and developers to just "fix" a problem without doing proper testing. As far as the "Someone" with destructive privleges, if it's not a developer, that someone is less likely to go poking around a production system.



'Anthony' on Wed, 13 May 2009 18:37:13 GMT, sez:

Wont work for me. Colorblindness sort of hinders that sort of thing.



'lb' on Wed, 13 May 2009 19:16:41 GMT, sez:

@Anthony
Yes indeed, it would need to be configurable.

Chad Miller points out (above) that this feature is available in SSMS 2008. I expect they've made it configurable enough to handle for colour blindness.



'Anthony' on Wed, 13 May 2009 23:10:24 GMT, sez:

Cool! I will have to give that a shot when I install it.




name


website (optional)


enter the word:
 

comment (HTML not allowed)


All viewpoints welcome. But the right to delete any post for any reason is reserved. Don't make me do it. Comments may be republished, emailed to your loved ones or printed and used as toilet paper. Who reads this legal bit anyhow?

TimeSnapper is a life analysis system that stores and plays-back your computer use. It makes timesheet recording a breeze, helps you recover lost work and shows you how to sharpen your act.

TimeSnapper won last year's Developer Competition at Larkware.com, and is used by over 10,000 people.

Articles

The Movie Hollywood (And My Wife) Doesn't Want You To See: Weekend at Jacko's The Movie Hollywood (And My Wife) Doesn't Want You To See: Weekend at Jacko's
Sysi: the ultimate administrators toolkit Sysi: the ultimate administrators toolkit
Movie: Priest Academy Movie: Priest Academy
Inspirational Rat Story Inspirational Rat Story
A face-melting DSL that allows programming ON the iPhone (and iPad) A face-melting DSL that allows programming ON the iPhone (and iPad)
The secretGeek Disaster Recovery plan The secretGeek Disaster Recovery plan
Save KNVTn! Before it's too late Save KNVTn! Before it's too late
The Ultimate Agent of WERF Destruction The Ultimate Agent of WERF Destruction
The new prisoner's dilemma The new prisoner's dilemma
Original Premise for a road movie Original Premise for a road movie
What's a better game than Devshop? What's a better game than Devshop?
DevShop: The Cool Game that Makes Development Look Fun DevShop: The Cool Game that Makes Development Look Fun
Should be purple Should be purple
Kitchen Agile Kitchen Agile
Perhaps Perhaps "Go" is the new Visual Basic
zen-coding: turn those CSS selectors upside down zen-coding: turn those CSS selectors upside down
Debugging: It's all about finding Albuquerque. Debugging: It's all about finding Albuquerque.
The Real-Time online JQuery Editor The Real-Time online JQuery Editor
HTML5, a 3 minute guide HTML5, a 3 minute guide
Developer Codpieces Developer Codpieces
Agile for one: The Personal Story 'Wall' In Action Agile for one: The Personal Story 'Wall' In Action
Never work with thick people. Never work with thick people.
Cosmo: project status panel Cosmo: project status panel
Windows Search in Japan Windows Search in Japan
Project Management Zen Project Management Zen
Continuous Integration, Plugins and Going Too Far Continuous Integration, Plugins and Going Too Far
The Rules of Stand Up The Rules of Stand Up
Sydney International Airport: Stupid, Criminal, or Criminally Stupid? Sydney International Airport: Stupid, Criminal, or Criminally Stupid?
God No! ...The ReBuilder God No! ...The ReBuilder
Matt, The Office Mortar Matt, The Office Mortar
'Outlook style' rules for Subversion 'Outlook style' rules for Subversion
Really deep linking: Url + regex Really deep linking: Url + regex
hExcel -- A Hexagonal Spreadsheet hExcel -- A Hexagonal Spreadsheet
Is the remote control a thing of the past? Is the remote control a thing of the past?
The Utterly Thorough Guide To Awesome Application Compatibility on Windows 7. The Utterly Thorough Guide To Awesome Application Compatibility on Windows 7.
Astounding Hyperlinked Noticeboard Astounding Hyperlinked Noticeboard
Three Questions About Each Bug You Find Three Questions About Each Bug You Find
Recursing over the Pareto Principle... Recursing over the Pareto Principle...
Sometimes, The Better You Program, The Worse You Communicate. Sometimes, The Better You Program, The Worse You Communicate.

Archives .: secretGeek :: Complete Archives
TimeSnapper -- Automated Screenshot Journal TimeSnapper.com    
Version 3.3: true productivity boost

Next Action NextAction
Managing the top of your mind

World's Simplest Code Generator (html edition) World's Simplest Code Generator

25 steps for building a Micro-ISV 25 steps for building a Micro-ISV
3 minute guides -- babysteps in new technologies: powershell, JSON, watir, F# 3 Minute Guide Series
Universal Troubleshooting checklist Universal Troubleshooting Checklist
Top 10 SecretGeek articles Top 10 SecretGeek articles
ShinyPower (help with Powershell) ShinyPower
Now at CodePlex

Realtime CSS Editor, in a browser RealTime Online CSS Editor
Gradient Maker -- a tool for making background images that blend from one colour to another. Forget photoshop, this is the bomb. Gradient Maker


[powered by Google] 


How to be depressed How to be depressed
You are not inadequate.



Recommended Reading

The Best Software Writing I
The Business Of Software (Eric Sink)

Recommended blogs

Jeff Atwood
Reginald Braithwaite
Joseph Cooney
Phil Haack
Scott Hanselman
Julia Lerman
Rhys Parry
Joel Pobar
OJ Reeves
Eric Sink
Joel Spolsky
Des Traynor

Aggregated Links

programming.reddit.com
dzone
dot net kicks

Human Link Machines

interesting finds
a continuous learner's weblog
arjan's world
n links today
new and notable
morning coffee
learning .net
weekly link post
(my del.icio.us account)

LinkedIn profile
 
home .: about .: sign up .: sitemap .: secretGeek RSS .: © Leon Bambrick 2006 .: privacy

home .: about .: sign up .: sitemap .: RSS .: © Leon Bambrick 2006 .: privacy