473,569 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to "undo" a database delete

Hello everybody,

I have an intranet application which is mostly a bunch of data editing
forms.

The database has about 20 tables all related together.

Recently somebody deleted a "the wrong record" and the cascade delete
in sql server did its work nicely :(

When they asked me to put the data back, I looked pretty stupid
as I had no idea how.

How is this normally done in ASP.NET app?

Morgan

Nov 19 '05 #1
13 2372
I supposed this is not quite an ASP.NET related question, it's more database
related.

So you should tell us what database you're using.And if you're using MSSQL,
you'll get better chance being answered if you're posting in
microsoft.publi c.sqlserver.ser ver newsgroup.

"Morgan Bachu" <ds********@tis cali.co.uk>
???????:11***** *************** **@g14g2000cwa. googlegroups.co m...
Hello everybody,

I have an intranet application which is mostly a bunch of data editing
forms.

The database has about 20 tables all related together.

Recently somebody deleted a "the wrong record" and the cascade delete
in sql server did its work nicely :(

When they asked me to put the data back, I looked pretty stupid
as I had no idea how.

How is this normally done in ASP.NET app?

Morgan

Nov 19 '05 #2
Morgan Bachu wrote:
Hello everybody,

I have an intranet application which is mostly a bunch of data editing
forms.

The database has about 20 tables all related together.

Recently somebody deleted a "the wrong record" and the cascade delete
in sql server did its work nicely :(

When they asked me to put the data back, I looked pretty stupid
as I had no idea how.

How is this normally done in ASP.NET app?

Morgan


If it's deleted from the database, then it is gone (no "recycle bin")!
Time to check if the backup procedure really works, I'm afraid.

Hans Kesting
Nov 19 '05 #3

What database is it ? Sql server, Access, ...

Let me know if you have any more questions...

Cheers,
Tom Pester
Hello everybody,

I have an intranet application which is mostly a bunch of data editing
forms.

The database has about 20 tables all related together.

Recently somebody deleted a "the wrong record" and the cascade delete
in sql server did its work nicely :(

When they asked me to put the data back, I looked pretty stupid as I
had no idea how.

How is this normally done in ASP.NET app?

Morgan

Nov 19 '05 #4
I remember that if it's MS Access or so, when the record is deleted but not
packed, there's some change to recover...

"Hans Kesting" <ne***********@ spamgourmet.com > ¼¶¼g©ó¶l¥ó·s»D: e5************* *@TK2MSFTNGP15. phx.gbl...
Morgan Bachu wrote:
Hello everybody,

I have an intranet application which is mostly a bunch of data editing
forms.

The database has about 20 tables all related together.

Recently somebody deleted a "the wrong record" and the cascade delete
in sql server did its work nicely :(

When they asked me to put the data back, I looked pretty stupid
as I had no idea how.

How is this normally done in ASP.NET app?

Morgan


If it's deleted from the database, then it is gone (no "recycle bin")!
Time to check if the backup procedure really works, I'm afraid.

Hans Kesting

Nov 19 '05 #5

What I would do is set up an identical set of tables, prefaced
"bk_thetablenam e" and store any records deleted in *that* set of tables.

Kind of like an audit trail.

That way, although you delete records,
you still keep all records, deleted or not, permanently.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Morgan Bachu" <ds********@tis cali.co.uk> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Hello everybody,

I have an intranet application which is mostly a bunch of data editing
forms.

The database has about 20 tables all related together.

Recently somebody deleted a "the wrong record" and the cascade delete
in sql server did its work nicely :(

When they asked me to put the data back, I looked pretty stupid
as I had no idea how.

How is this normally done in ASP.NET app?

Morgan

Nov 19 '05 #6

In sql server you can undelete it by examening the transaction log. There
are tools to make it easy.

A general approuch it to take backups so you can go back in time or do the
undelete manualy with some copy & pasting.

Cheers,
Tom Pester
Morgan Bachu wrote:
Hello everybody,

I have an intranet application which is mostly a bunch of data
editing forms.

The database has about 20 tables all related together.

Recently somebody deleted a "the wrong record" and the cascade delete
in sql server did its work nicely :(

When they asked me to put the data back, I looked pretty stupid as I
had no idea how.

How is this normally done in ASP.NET app?

Morgan

If it's deleted from the database, then it is gone (no "recycle bin")!
Time to check if the backup procedure really works, I'm afraid.

Hans Kesting

Nov 19 '05 #7

Or you could do a soft delete. When the user deletes a row you flip a switch
in a column, so :

delete from table where id = 8
becomes
update table set deleted = true

You can make it transparent for the developer by making a view of the table
like this :

Employees_All : a table that has also the deleted records
Employees : SELECT * FROM Employees where deleted = false

Let me know if you have any more questions...

Cheers,
Tom Pester
What I would do is set up an identical set of tables, prefaced
"bk_thetablenam e" and store any records deleted in *that* set of
tables.

Kind of like an audit trail.

That way, although you delete records,
you still keep all records, deleted or not, permanently.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======
"Morgan Bachu" <ds********@tis cali.co.uk> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Hello everybody,

I have an intranet application which is mostly a bunch of data
editing forms.

The database has about 20 tables all related together.

Recently somebody deleted a "the wrong record" and the cascade delete
in sql server did its work nicely :(

When they asked me to put the data back, I looked pretty stupid as I
had no idea how.

How is this normally done in ASP.NET app?

Morgan

Nov 19 '05 #8
Morgan,

This isn't so much of an ASP.NET question as it is an application design
question.

If an application I build allows the user to delete anything it is at most
only a logical delete. Basically I have a field in each table named
isDeleted. If set to true then that row is 'logically' deleted when it comes
to the application but the data is still there.

In one case I even created a Deleted Items page so the admins could go see
what's been deleted and 'un-delete' anything they wanted to.

"Morgan Bachu" wrote:
Hello everybody,

I have an intranet application which is mostly a bunch of data editing
forms.

The database has about 20 tables all related together.

Recently somebody deleted a "the wrong record" and the cascade delete
in sql server did its work nicely :(

When they asked me to put the data back, I looked pretty stupid
as I had no idea how.

How is this normally done in ASP.NET app?

Morgan

Nov 19 '05 #9
That is a viable database design idea, too.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"tom pester" <To************ ********@pandor a.be> wrote in message
news:a1******** *************** ****@news.micro soft.com...

Or you could do a soft delete. When the user deletes a row you flip a switch in a
column, so :

delete from table where id = 8
becomes
update table set deleted = true

You can make it transparent for the developer by making a view of the table like this :

Employees_All : a table that has also the deleted records
Employees : SELECT * FROM Employees where deleted = false

Let me know if you have any more questions...

Cheers,
Tom Pester
What I would do is set up an identical set of tables, prefaced
"bk_thetablenam e" and store any records deleted in *that* set of
tables.

Kind of like an audit trail.

That way, although you delete records,
you still keep all records, deleted or not, permanently.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======
"Morgan Bachu" <ds********@tis cali.co.uk> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Hello everybody,

I have an intranet application which is mostly a bunch of data
editing forms.

The database has about 20 tables all related together.

Recently somebody deleted a "the wrong record" and the cascade delete
in sql server did its work nicely :(

When they asked me to put the data back, I looked pretty stupid as I
had no idea how.

How is this normally done in ASP.NET app?

Morgan


Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3254
by: dsfsdfs878 | last post by:
Hello, Somebody accidently deleted a record with cascade deletes and took out about 80 records. The database has been used heavily since then. How do I put back the data? I have spent hours researching BOL and all I can find
14
1647
by: ss.wisch | last post by:
Ok here's the thing... I have a vBulletin forum database... there is a table in there called "post" which has all of my forums posts in it. What I have are many posts with regular titles like "Oh hello how are you" or whatever, and many posts (which are replies) with "Re:" before them and whatever message following that. I have recently...
3
4599
by: Paul | last post by:
I have an Access 2000 database with a form that is giving me some major headaches. When you open the form, it displays all records and allows editing, but has AllowAdditions set to False so that the user has to use my New Record button. When you click the New Record button, the form presents a new record for editing. My client wants to use...
3
11621
by: babylon | last post by:
any facilities in csharp that can help me implmenting undo/redo in my application? thx
3
4538
by: Carpe Diem | last post by:
Hello I have an aspx page that loses Session("user") value after a few minutes even after I set <sessionState mode="InProc" cookieless="false" timeout="300"> in web.config and wrote function Session_Start() { Session.Timeout = 3000; } in global.asax
2
2775
by: monkey3333sg | last post by:
I would like to add an "undo" button in my programme
0
1253
by: monkey3333sg | last post by:
I am programming some flow chart program using VB6... which is similar to Visual Logic software... I would like to add in "Undo" and "Redo" part...anyone can help? Thank you.
7
16345
by: PW | last post by:
Hi, I have a form with unbound fields on it. The user selects a record from a recordset and I populate the unbound fields. When I try to change the unbound quantity text box, Access 2003 tells me "The data has been changed. Another user edited this record and saved the changes before you attempted to save your changes. Re-edit the...
1
1167
by: Nilam2477 | last post by:
I have a form with multiple TextBox controls and few other controls like comboBox, checkBox etc. I'm trying to implement Undo functionality for all the controls in the form. I'm using Push & Pop operations of Stack to store the control values. My question is regarding the TextBox control. I would like to know on which event of TextBox control i...
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.