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 (448K reputation)SSC Guru (448K reputation)SSC Guru (448K reputation)SSC Guru (448K reputation)SSC Guru (448K reputation)SSC Guru (448K reputation)SSC Guru (448K reputation)SSC Guru (448K reputation)

Group: Administrators
Points: 448858 Visits: 20590
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 Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 41
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
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12602 Visits: 3122
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 Journeyman
SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)SSC Journeyman (80 reputation)

Group: General Forum Members
Points: 80 Visits: 382
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
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1928 Visits: 398

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
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11083 Visits: 2274
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
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1928 Visits: 398

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
Old Hand
Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)Old Hand (390 reputation)

Group: General Forum Members
Points: 390 Visits: 114
Maybe there is an easy way to use something like "where environment <> 'PROD' " in update and delete statements?
jonathan 33820
jonathan 33820
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 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 Journeyman
SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)

Group: General Forum Members
Points: 98 Visits: 369
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