Replace existing Database? JFDI!

  • Comments posted to this topic are about the item Replace existing Database? JFDI!

  • 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?

  • 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 :-).

  • 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.

  • @tony-2

    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

    ? πŸ™‚

  • 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

  • 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. ...:-D"

  • 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!

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply