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. Web Development
  3. ASP.NET
  4. retrieve deleted record

retrieve deleted record

Scheduled Pinned Locked Moved ASP.NET
helpquestiondatabase
13 Posts 6 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.
  • I Offline
    I Offline
    Imran Khan Pathan
    wrote on last edited by
    #1

    Hi friends I have a bit problem here I want to get back all deleted record of database How do i preform this task? If it is possibel then plz help me out. Thanks Pathan

    ---------------------------------------------------

    D N 2 Replies Last reply
    0
    • I Imran Khan Pathan

      Hi friends I have a bit problem here I want to get back all deleted record of database How do i preform this task? If it is possibel then plz help me out. Thanks Pathan

      ---------------------------------------------------

      D Offline
      D Offline
      Deepak the Cool
      wrote on last edited by
      #2

      You can Create a Trigger into DB with following select query select * from deleted deleted is a logical table which store data temprirory into it. but it is only for while whn next delete or other statements will fire. and also mind it is not select Image,ntext or other data type which store a large amount of data. hope tht will help you......

      Deepak Smile a Lots,Its Costs Nothing

      S H I T 4 Replies Last reply
      0
      • D Deepak the Cool

        You can Create a Trigger into DB with following select query select * from deleted deleted is a logical table which store data temprirory into it. but it is only for while whn next delete or other statements will fire. and also mind it is not select Image,ntext or other data type which store a large amount of data. hope tht will help you......

        Deepak Smile a Lots,Its Costs Nothing

        S Offline
        S Offline
        Sonia Gupta
        wrote on last edited by
        #3

        my database is ms-access,i tried the query , u provided.it is giving an error message the microsoft jet engine cannot find the input table or query deleted. Make sure it exist or it's name is spelled correctly.

        Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....

        D 1 Reply Last reply
        0
        • D Deepak the Cool

          You can Create a Trigger into DB with following select query select * from deleted deleted is a logical table which store data temprirory into it. but it is only for while whn next delete or other statements will fire. and also mind it is not select Image,ntext or other data type which store a large amount of data. hope tht will help you......

          Deepak Smile a Lots,Its Costs Nothing

          H Offline
          H Offline
          Hari_1010
          wrote on last edited by
          #4

          Hi Deepak, I tried to run the statement you have provided "select * from deleted". But its saying "Invalid object name deleted". I am using SQL Server 2005. Regards, Hariharan C

          1 Reply Last reply
          0
          • D Deepak the Cool

            You can Create a Trigger into DB with following select query select * from deleted deleted is a logical table which store data temprirory into it. but it is only for while whn next delete or other statements will fire. and also mind it is not select Image,ntext or other data type which store a large amount of data. hope tht will help you......

            Deepak Smile a Lots,Its Costs Nothing

            I Offline
            I Offline
            Imran Khan Pathan
            wrote on last edited by
            #5

            Do I need to create Trigger in DB? But what If want to get previous deleted record Actually yesterday I deleted one company record from database and now I need to get back. Thanks Pathan

            ---------------------------------------------------

            D 1 Reply Last reply
            0
            • S Sonia Gupta

              my database is ms-access,i tried the query , u provided.it is giving an error message the microsoft jet engine cannot find the input table or query deleted. Make sure it exist or it's name is spelled correctly.

              Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....

              D Offline
              D Offline
              Deepak the Cool
              wrote on last edited by
              #6

              As per as concern about your reply i dont know about the MS-Access.I had to solve it in SQl Server and create a Audit Trail through this particular query.or write # before the deleted....... :)

              Deepak Smile a Lots,Its Costs Nothing

              S 1 Reply Last reply
              0
              • I Imran Khan Pathan

                Do I need to create Trigger in DB? But what If want to get previous deleted record Actually yesterday I deleted one company record from database and now I need to get back. Thanks Pathan

                ---------------------------------------------------

                D Offline
                D Offline
                Deepak the Cool
                wrote on last edited by
                #7

                Just go through the following code for trigger it is only works on For DELETE or After,Insted,Before Create TRIGGER TR_Delete_Package ON Package for DELETE AS Begin if((select Count(*) from deleted) > 0) Begin -- if BEGIN /* --------------- Declaration of variable ------*/ End -- Trigger :)

                Deepak Smile a Lots,Its Costs Nothing

                S 1 Reply Last reply
                0
                • D Deepak the Cool

                  As per as concern about your reply i dont know about the MS-Access.I had to solve it in SQl Server and create a Audit Trail through this particular query.or write # before the deleted....... :)

                  Deepak Smile a Lots,Its Costs Nothing

                  S Offline
                  S Offline
                  Sonia Gupta
                  wrote on last edited by
                  #8

                  in sql server too it is not poviding the result

                  Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....

                  D 1 Reply Last reply
                  0
                  • D Deepak the Cool

                    Just go through the following code for trigger it is only works on For DELETE or After,Insted,Before Create TRIGGER TR_Delete_Package ON Package for DELETE AS Begin if((select Count(*) from deleted) > 0) Begin -- if BEGIN /* --------------- Declaration of variable ------*/ End -- Trigger :)

                    Deepak Smile a Lots,Its Costs Nothing

                    S Offline
                    S Offline
                    Sonia Gupta
                    wrote on last edited by
                    #9

                    i was checking for triggers in the sql server 2000. i diid not find any options there for the triggers to create a new one.

                    Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....

                    1 Reply Last reply
                    0
                    • S Sonia Gupta

                      in sql server too it is not poviding the result

                      Sonia Gupta Soniagupta1@yahoo.co.in Yahoo messengerId-soniagupta1 Love is Friendship and Friendship is Love....

                      D Offline
                      D Offline
                      Deepak the Cool
                      wrote on last edited by
                      #10

                      Just go through the following code for trigger it is only works on For DELETE or After,Insted,Before Create TRIGGER TR_Delete_Package ON Package for DELETE AS Begin if((select Count(*) from deleted) > 0) Begin -- if BEGIN /* --------------- Declaration of variable ------*/ End -- Trigger

                      Deepak Smile a Lots,Its Costs Nothing

                      1 Reply Last reply
                      0
                      • D Deepak the Cool

                        You can Create a Trigger into DB with following select query select * from deleted deleted is a logical table which store data temprirory into it. but it is only for while whn next delete or other statements will fire. and also mind it is not select Image,ntext or other data type which store a large amount of data. hope tht will help you......

                        Deepak Smile a Lots,Its Costs Nothing

                        T Offline
                        T Offline
                        T EDY
                        wrote on last edited by
                        #11

                        dcjoshi2 wrote:

                        select * from deleted

                        is "deleted" mean your table name? if u use that query..SQL will recognize deleted as a table, if u dont have a table name deleted in your database it will output an error message:confused::confused::confused:

                        Kind Regards, Tomi

                        1 Reply Last reply
                        0
                        • I Imran Khan Pathan

                          Hi friends I have a bit problem here I want to get back all deleted record of database How do i preform this task? If it is possibel then plz help me out. Thanks Pathan

                          ---------------------------------------------------

                          N Offline
                          N Offline
                          N a v a n e e t h
                          wrote on last edited by
                          #12

                          Imran Khan Pathan wrote:

                          I want to get back all deleted record of database

                          You can't

                          Imran Khan Pathan wrote:

                          How do i preform this task?

                          Currently deleted records you can't revert back, but you can solve this problem for future by adding IsDeleted(it's a column name, can be changed to any name) column to the table. When user asks for deletion, don't delete from table, just change this IsDeleted column value. When fetching the data you need fetch only rows which are having IsDeleted value 'no'.


                          My Website | Ask smart questions

                          I 1 Reply Last reply
                          0
                          • N N a v a n e e t h

                            Imran Khan Pathan wrote:

                            I want to get back all deleted record of database

                            You can't

                            Imran Khan Pathan wrote:

                            How do i preform this task?

                            Currently deleted records you can't revert back, but you can solve this problem for future by adding IsDeleted(it's a column name, can be changed to any name) column to the table. When user asks for deletion, don't delete from table, just change this IsDeleted column value. When fetching the data you need fetch only rows which are having IsDeleted value 'no'.


                            My Website | Ask smart questions

                            I Offline
                            I Offline
                            Imran Khan Pathan
                            wrote on last edited by
                            #13

                            My dear Navaneeth I have just read many articles and blogs and it is possible. Just wait.............................. Best regard Pathan

                            ---------------------------------------------------

                            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