Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Replace existing Database? JFDI! Expand / Collapse
Author
Message
Posted Saturday, March 31, 2012 12:15 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: Administrators
Last Login: Yesterday @ 5:25 AM
Points: 569, Visits: 1,018
Comments posted to this topic are about the item Replace existing Database? JFDI!
Post #1276203
Posted Sunday, April 1, 2012 3:09 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, May 27, 2014 7:17 PM
Points: 197, Visits: 459
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?
Post #1276304
Posted Sunday, April 1, 2012 4:51 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: Administrators
Last Login: Yesterday @ 5:25 AM
Points: 569, Visits: 1,018
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 .
Post #1276309
Posted Sunday, April 1, 2012 12:56 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, January 16, 2013 4:23 PM
Points: 415, Visits: 2,333
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.
Post #1276405
Posted Sunday, April 1, 2012 7:30 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, May 27, 2014 7:17 PM
Points: 197, Visits: 459
@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

?
Post #1276430
Posted Monday, April 2, 2012 9:33 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, August 22, 2014 12:19 PM
Points: 2,107, Visits: 3,582
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
SQL Tentmaker
“He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot
Post #1276707
Posted Monday, April 2, 2012 10:40 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, March 6, 2014 1:05 PM
Points: 1,334, Visits: 3,068
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.


"Technology is a weird thing. It brings you great gifts with one hand, and it stabs you in the back with the other. ..."
Post #1276753
Posted Monday, April 2, 2012 10:48 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: Administrators
Last Login: Yesterday @ 5:25 AM
Points: 569, Visits: 1,018
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!
Post #1276761
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse