This really is a lesser programming question and much more of the recommendations for tools one :-)

I am searching for a method to prevent scripts being accidentally operate on the incorrect sql server instance, ie which means you don't run that script for clearing lower clients inside your development atmosphere around the live/production atmosphere.

What I am essentially after is really a pluging for Enterprise Manager (or perhaps a different application for controlling a sql server instance), that will let me define a listing of connection particulars for SQL server instances, to ensure that once the window is attached to an active atmosphere it causes it to be quite obvious, either by coloring the tab red-colored, or by poping up a note box saying "This really is attached to XXXX instance. Are you certainInch

Asside form being really careful, does anybody have suggestions for tools/plug ins that is going to do this or anything remotely simular?

Thank you for any help

My scripts begin with this :

if exists (select 1 from dbo.environment where value in('production', 'qa'))

Obviously which means that I've an atmosphere table and also have 'production' , 'development' , 'qa' etc. inside it based on where it's located.

here you decide to go:

this free SSMS addin provides home windows coloring per server.

This SQL code inspections if you are around the right server:

if @@servername <> 'testserver'
  RAISERROR ( 'Wrong server', 16, 1 );

A mistake (or return for your matter), may prevent execution before the next GO statement. For instance, the next will still print hello world, and remove the consumer table:

RAISERROR ( 'Wrong server', 16, 1 );
drop table users
print 'Hello world!'

You are able to set different (limited) access directly on you reside instance for that user you normally use. After which possess a different user reputation for doing any serious stuff around the live system.