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. Database & SysAdmin
  3. Database
  4. Action Queries [modified]

Action Queries [modified]

Scheduled Pinned Locked Moved Database
databasesql-serversysadminquestion
3 Posts 2 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.
  • X Offline
    X Offline
    xfitr2
    wrote on last edited by
    #1

    Is there a way to view the results of an action query without committing the changes to the database in SQL Server 2000? Any suggestions or tips will be greatly appreciated. -Garrett

    C 1 Reply Last reply
    0
    • X xfitr2

      Is there a way to view the results of an action query without committing the changes to the database in SQL Server 2000? Any suggestions or tips will be greatly appreciated. -Garrett

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      I'm not really sure how wise this is but this:

      SELECT * FROM [Order Details]
      BEGIN TRANSACTION
      DELETE FROM [Order Details]
      SELECT * FROM [Order Details]
      ROLLBACK TRANSACTION
      SELECT * FROM [Order Details]

      This shows the state of the Order Details table, then it shows the result of the delete operation, but after the transaction is rolled back the state of the database reverts. Is this the kind of thing you are looking for? [ADDITION] I should point out that this does actually make changes to the database and it could impact performance of other things running in the database. [/ADDITION]


      "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog -- modified at 12:51 Monday 22nd May, 2006

      X 1 Reply Last reply
      0
      • C Colin Angus Mackay

        I'm not really sure how wise this is but this:

        SELECT * FROM [Order Details]
        BEGIN TRANSACTION
        DELETE FROM [Order Details]
        SELECT * FROM [Order Details]
        ROLLBACK TRANSACTION
        SELECT * FROM [Order Details]

        This shows the state of the Order Details table, then it shows the result of the delete operation, but after the transaction is rolled back the state of the database reverts. Is this the kind of thing you are looking for? [ADDITION] I should point out that this does actually make changes to the database and it could impact performance of other things running in the database. [/ADDITION]


        "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog -- modified at 12:51 Monday 22nd May, 2006

        X Offline
        X Offline
        xfitr2
        wrote on last edited by
        #3

        Pretty much. Thanks for the help.

        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