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


The Right Connection


The Right Connection

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (682K reputation)SSC Guru (682K reputation)SSC Guru (682K reputation)SSC Guru (682K reputation)SSC Guru (682K reputation)SSC Guru (682K reputation)SSC Guru (682K reputation)SSC Guru (682K reputation)

Group: Administrators
Points: 682832 Visits: 21588
Comments posted to this topic are about the item The Right Connection

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
aklt
aklt
SSC-Enthusiastic
SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)

Group: General Forum Members
Points: 131 Visits: 193
I use the same solution for both when using an SSMS on my local computer as well as when using RDP. Use a horrible background color (red works well). That way there is no chance to know your not on a production server.
If you are using the same AD account on your own computer as well as on the production server... you nuts?
If you develop stuff as well as do things in production you really should have 2 accounts, as to limit the risks. A developer account should, in my mind, never have prod access.
Setting connection color... the color on the Tabs/statusbar is just to little to catch ones eye. But if the entire background is a different color... hard to miss.
Phil Factor
Phil Factor
SSCoach
SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)

Group: General Forum Members
Points: 19330 Visits: 3198
Maybe we should train our subconscious mind into good habits by treating all servers as though they were production servers.


Best wishes,

Phil Factor
Simple Talk
rashid.hussain
rashid.hussain
SSC-Enthusiastic
SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)

Group: General Forum Members
Points: 128 Visits: 392
My method is taking advantage of having 2 physical monitors, (switch this up the way you choose) so the left monitor is for SSMS into Production or Pre-Prod ONLY and then the monitor on the right is for everything else.
I also use the coloured tabs in SSMS as an extra fail safe.
Andy Robertson
Andy Robertson
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4283 Visits: 738

Four part naming anyone? Does anyone ever do that? I use three part naming when shifting stuff around different DBs on the same server quite often.

My tip for those, like me, who have to perform lots of CRUD ops on production databases is to always write your query as a "Select" first to check what you are going to insert/update/delete/screw up!. If you are not sure that the results of your "Select" are what you are expecting then double check it (store a copy somewhere so you can recover it easily). Only change your query to the update/delete/insert at the very end when you are 100 percent confident that it is doing what you want. Even then you will make mistakes because your expectations were incorrect.

Always consider how you will undo/retrieve/fix what you have done before you do it!

I do development and also have to manage and update live data. I wouldn't use a different account/connection each time it's just not practical.


call.copse
call.copse
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16181 Visits: 2532
There's not much you can really do apart from ensuring you think and check what you're doing anytime you run any data modifying query. Check the tab, check the database you're on, verify then run.
Andy Robertson
Andy Robertson
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4283 Visits: 738

It would probably help a great deal if servers had better names... they always seem to be algebraic. How would the average developer know if it was production or not?


k.schouten
k.schouten
Mr or Mrs. 500
Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)

Group: General Forum Members
Points: 518 Visits: 115
Maybe there is an easy way to use something like "where environment <> 'PROD' " in update and delete statements?
jonathan 33820
jonathan 33820
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 39
Good article. Great to know about colors!
I always start a new instance of SSMS for each database this way all tabs point to the same dm.
I resize the window that I am not working on making it tall and skinny or or short and wide so it is clear that this is the "other" DB.
When I write an ad hoc insert or delete I write it like this:
Select *
--DELETE
From TableName WHERE
A=1 AND ...
If I execute the whole page then this is just a select. I can test the where clause with the select like the other poster said. The WHERE hanging at the end of the line will break the query if I don't also include the conditions (that often will not fit on the same line).
I drink lot's of coffee.
garry.lovesey
garry.lovesey
SSC Veteran
SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)SSC Veteran (253 reputation)

Group: General Forum Members
Points: 253 Visits: 376
Personally, this article is more likely to make me trust the company.
They acknowledged the issue, laid out their findings on what happened, owned up to their shortcomings and outlined improvements going forward. That is the sort of company that I would do business with.
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