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


Replace existing Database? JFDI!


Replace existing Database? JFDI!

Author
Message
Tony Davis
Tony Davis
SSC Eights!
SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)

Group: Administrators
Points: 919 Visits: 1160
Comments posted to this topic are about the item Replace existing Database? JFDI!
Alex Fekken
Alex Fekken
SSC Veteran
SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)

Group: General Forum Members
Points: 277 Visits: 460
I am usually quite happy to criticise what I think are bad aspects of SQL Server (or other products), but in this case I am more inclined to say:

Which part of REPLACE don't you get then?
Tony Davis
Tony Davis
SSC Eights!
SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)

Group: Administrators
Points: 919 Visits: 1160
As I tried to express in the editorial, I guess I initially, and wrongly, had a tendency to see REPLACE as "general purpose" command, whenever restoring over an existing database, and so included it in code where it wasn't necessary. It struck me as a case where a better name might encourage a more cautious approach to its use, though I hardly intended the piece as a strident criticism of SQL Server.

If it turns out I'm the only one who was initially unaware of the "safety checks" that use of REPLACE disables then we can all move on :-).
patrickmcginnis59
patrickmcginnis59
SSChasing Mays
SSChasing Mays (655 reputation)SSChasing Mays (655 reputation)SSChasing Mays (655 reputation)SSChasing Mays (655 reputation)SSChasing Mays (655 reputation)SSChasing Mays (655 reputation)SSChasing Mays (655 reputation)SSChasing Mays (655 reputation)

Group: General Forum Members
Points: 655 Visits: 2333
user interface is hard! I like the idea of a "force" like keyword being required when bypassing all the safety checks, but its probably best to research combinations of keywords especially with T-SQL. I know this website wouldn't be the first to contain remarks about unexpected behavior with SQL server.
Alex Fekken
Alex Fekken
SSC Veteran
SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)SSC Veteran (277 reputation)

Group: General Forum Members
Points: 277 Visits: 460
@Tony

It's probably a matter of taste but I do not see the difference between REPLACE and FORCE_OVERWRITE, except more characters to type; perhaps because English isn't my native language.

And shouldn't you then have the same, or even more, concerns about (for example) UPDATE-without-WHERE? This is much likely to happen because it is not just DBAs that are likely to have permissions to execute one of those... So perhaps we would need

UPDATE ...
SET ...
WITH FORCE_UPDATE_EVEN_WITHOUT_WHERE

? :-)
David Benoit
David Benoit
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3394 Visits: 3650
Tony Davis (4/1/2012)

If it turns out I'm the only one who was initially unaware of the "safety checks" that use of REPLACE disables then we can all move on :-).


Uh, errr, ummm, well, I always assumed the same Tony. So, I'm sheepishly laughing here but thankful for the additional information. I'll certainly be doing a bit more reading.

David

@SQLTentmaker

“He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot
TravisDBA
TravisDBA
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1998 Visits: 3069
If it turns out I'm the only one who was initially unaware of the "safety checks" that use of REPLACE disables then we can all move on :-).


Time to move on. :-D

"Technology is a weird thing. It brings you great gifts with one hand, and it stabs you in the back with the other. ...:-D"
Tony Davis
Tony Davis
SSC Eights!
SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)SSC Eights! (919 reputation)

Group: Administrators
Points: 919 Visits: 1160
Thanks everyone, for the feedback.

Personally, I'd be very surprised if everyone was aware of it, plus the concept of a "force flag" that indicates when certain checks are being bypassed is hardly a new one.

Anyway, onwards and upwards!
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