Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Not a good day to end the day.

Not a good day to end the day.

Scheduled Pinned Locked Moved The Lounge
questioncomhelptutorialannouncement
16 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yusuf
    wrote on last edited by
    #1

    I meant to delete five rows from a table and wrote very quickly this

    delete dbo.tblXYZ
    where ID >= 116 or ID <= 120

    ended blowing the whole table away. Talk about blowing your feet off I know, I know it should have been AND not OR, it is too late now. :-O UPDATE: I have a backup, but lost a hour worth of work...

    Yusuf May I help you?

    D Richard Andrew x64R Mike HankeyM J CPalliniC 6 Replies Last reply
    0
    • Y Yusuf

      I meant to delete five rows from a table and wrote very quickly this

      delete dbo.tblXYZ
      where ID >= 116 or ID <= 120

      ended blowing the whole table away. Talk about blowing your feet off I know, I know it should have been AND not OR, it is too late now. :-O UPDATE: I have a backup, but lost a hour worth of work...

      Yusuf May I help you?

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      Ummm, is "I didn't do it" an option? If not, run, run away.

      My CP workspace: Incredibly trivial and probably useless code samples[^]

      Y 1 Reply Last reply
      0
      • Y Yusuf

        I meant to delete five rows from a table and wrote very quickly this

        delete dbo.tblXYZ
        where ID >= 116 or ID <= 120

        ended blowing the whole table away. Talk about blowing your feet off I know, I know it should have been AND not OR, it is too late now. :-O UPDATE: I have a backup, but lost a hour worth of work...

        Yusuf May I help you?

        Richard Andrew x64R Offline
        Richard Andrew x64R Offline
        Richard Andrew x64
        wrote on last edited by
        #3

        To avoid such problems, I usually substitute a SELECT query using the desired conditional clause to see what records will be affected BEFORE executing the DELETE query. I hope it wasn't anything you can't recreate!

        The difficult we do right away... ...the impossible takes slightly longer.

        D M 2 Replies Last reply
        0
        • Richard Andrew x64R Richard Andrew x64

          To avoid such problems, I usually substitute a SELECT query using the desired conditional clause to see what records will be affected BEFORE executing the DELETE query. I hope it wasn't anything you can't recreate!

          The difficult we do right away... ...the impossible takes slightly longer.

          D Offline
          D Offline
          dan sh
          wrote on last edited by
          #4

          Real men do not care. They simply run the query. And then in middle of night they restore the backup that they did before running the query.

          My CP workspace: Incredibly trivial and probably useless code samples[^]

          Richard Andrew x64R Y 2 Replies Last reply
          0
          • D dan sh

            Real men do not care. They simply run the query. And then in middle of night they restore the backup that they did before running the query.

            My CP workspace: Incredibly trivial and probably useless code samples[^]

            Richard Andrew x64R Offline
            Richard Andrew x64R Offline
            Richard Andrew x64
            wrote on last edited by
            #5

            Let's hope the OP had a backup. :)

            The difficult we do right away... ...the impossible takes slightly longer.

            Y 1 Reply Last reply
            0
            • Y Yusuf

              I meant to delete five rows from a table and wrote very quickly this

              delete dbo.tblXYZ
              where ID >= 116 or ID <= 120

              ended blowing the whole table away. Talk about blowing your feet off I know, I know it should have been AND not OR, it is too late now. :-O UPDATE: I have a backup, but lost a hour worth of work...

              Yusuf May I help you?

              Mike HankeyM Offline
              Mike HankeyM Offline
              Mike Hankey
              wrote on last edited by
              #6

              You had backups of course? :)

              Along with Antimatter and Dark Matter they've discovered the existence of Doesn't Matter which appears to have no effect on the universe whatsoever! Rich Tennant 5th Wave

              Y 1 Reply Last reply
              0
              • Richard Andrew x64R Richard Andrew x64

                Let's hope the OP had a backup. :)

                The difficult we do right away... ...the impossible takes slightly longer.

                Y Offline
                Y Offline
                Yusuf
                wrote on last edited by
                #7

                I had a backup, but lost lost an hour worth of work, which is not bad considering the size of the table

                Yusuf May I help you?

                1 Reply Last reply
                0
                • Y Yusuf

                  I meant to delete five rows from a table and wrote very quickly this

                  delete dbo.tblXYZ
                  where ID >= 116 or ID <= 120

                  ended blowing the whole table away. Talk about blowing your feet off I know, I know it should have been AND not OR, it is too late now. :-O UPDATE: I have a backup, but lost a hour worth of work...

                  Yusuf May I help you?

                  J Offline
                  J Offline
                  Jorgen Andersson
                  wrote on last edited by
                  #8

                  That's what you use BETWEEN for. Less ambiguity.

                  Wrong is evil and must be defeated. - Jeff Ello[^]

                  1 Reply Last reply
                  0
                  • D dan sh

                    Real men do not care. They simply run the query. And then in middle of night they restore the backup that they did before running the query.

                    My CP workspace: Incredibly trivial and probably useless code samples[^]

                    Y Offline
                    Y Offline
                    Yusuf
                    wrote on last edited by
                    #9

                    being real man cost me my sleep ;P

                    Yusuf May I help you?

                    1 Reply Last reply
                    0
                    • Mike HankeyM Mike Hankey

                      You had backups of course? :)

                      Along with Antimatter and Dark Matter they've discovered the existence of Doesn't Matter which appears to have no effect on the universe whatsoever! Rich Tennant 5th Wave

                      Y Offline
                      Y Offline
                      Yusuf
                      wrote on last edited by
                      #10

                      what backup? Real men don't backup :doh: I do, but lost an hour worth of work, which is not bad considering the size of the table if I didn't backup

                      Yusuf May I help you?

                      Mike HankeyM 1 Reply Last reply
                      0
                      • D dan sh

                        Ummm, is "I didn't do it" an option? If not, run, run away.

                        My CP workspace: Incredibly trivial and probably useless code samples[^]

                        Y Offline
                        Y Offline
                        Yusuf
                        wrote on last edited by
                        #11

                        I'm the sole creator and maintainer of the data. No where to run :-O

                        Yusuf May I help you?

                        1 Reply Last reply
                        0
                        • Y Yusuf

                          what backup? Real men don't backup :doh: I do, but lost an hour worth of work, which is not bad considering the size of the table if I didn't backup

                          Yusuf May I help you?

                          Mike HankeyM Offline
                          Mike HankeyM Offline
                          Mike Hankey
                          wrote on last edited by
                          #12

                          Backup as in a bucket of 1s and 0s, in a logical order of course. :)

                          Along with Antimatter and Dark Matter they've discovered the existence of Doesn't Matter which appears to have no effect on the universe whatsoever! Rich Tennant 5th Wave

                          1 Reply Last reply
                          0
                          • Y Yusuf

                            I meant to delete five rows from a table and wrote very quickly this

                            delete dbo.tblXYZ
                            where ID >= 116 or ID <= 120

                            ended blowing the whole table away. Talk about blowing your feet off I know, I know it should have been AND not OR, it is too late now. :-O UPDATE: I have a backup, but lost a hour worth of work...

                            Yusuf May I help you?

                            CPalliniC Offline
                            CPalliniC Offline
                            CPallini
                            wrote on last edited by
                            #13

                            Klingon developers like bold personalities like yours.

                            Yusuf wrote:

                            UPDATE: I have a backup, but lost a hour worth of work...

                            Some man points gone away...

                            Veni, vidi, vici.

                            In testa che avete, signor di Ceprano?

                            Y 1 Reply Last reply
                            0
                            • CPalliniC CPallini

                              Klingon developers like bold personalities like yours.

                              Yusuf wrote:

                              UPDATE: I have a backup, but lost a hour worth of work...

                              Some man points gone away...

                              Veni, vidi, vici.

                              Y Offline
                              Y Offline
                              Yusuf
                              wrote on last edited by
                              #14

                              FTFY

                              CPallini wrote:

                              Some man Klingon points gone away...

                              Yusuf May I help you?

                              1 Reply Last reply
                              0
                              • Y Yusuf

                                I meant to delete five rows from a table and wrote very quickly this

                                delete dbo.tblXYZ
                                where ID >= 116 or ID <= 120

                                ended blowing the whole table away. Talk about blowing your feet off I know, I know it should have been AND not OR, it is too late now. :-O UPDATE: I have a backup, but lost a hour worth of work...

                                Yusuf May I help you?

                                L Offline
                                L Offline
                                Lost User
                                wrote on last edited by
                                #15

                                Have a template that says "START TRANSACTION" at the top; that way you can always rollback or commit your command.

                                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                                1 Reply Last reply
                                0
                                • Richard Andrew x64R Richard Andrew x64

                                  To avoid such problems, I usually substitute a SELECT query using the desired conditional clause to see what records will be affected BEFORE executing the DELETE query. I hope it wasn't anything you can't recreate!

                                  The difficult we do right away... ...the impossible takes slightly longer.

                                  M Offline
                                  M Offline
                                  Mycroft Holmes
                                  wrote on last edited by
                                  #16

                                  I do the same thing for an update as well, I may not qualify as a real man but I don't trash table these days.

                                  Never underestimate the power of human stupidity RAH

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups