Groups | Blog | Home
all groups > sql server programming > may 2004 >

sql server programming : Deleting records


Elizabeta
5/23/2004 7:26:04 PM
I have an application that should archive records, meaning that I want to move entire record into another table, serving as archive

First, I copy the required record into the archive table
Then, I delete from the main table

I do it in one stored procedure

I use Begin Trans
after writing into archive table I ask for errors
if @@error == 0 then
begi
delete from maintabl
if @@error ==
commit tran
els
rollback tran
end

The front end is in MSAccess 2000, with ADO objects activating this Stored Procedure

This works in most of the cases, but sometimes it happens that I have records deleted and not archived

Probably checking @@error is unable to find out if the record is correctly written on safe place

Does anybody know why is this happening, is it maybe MSaccess problem, or am I doing something wrong

How are you pepole, actually, doing archiving

biswajitdas
5/24/2004 12:01:04 AM
h

the logic is that first enter in to archive table

' if any problem then rollback

else delete form the tabl

end i

Uri Dimant
5/24/2004 7:06:20 AM
Hi
Narayana Vyas has very good article about it.
http://vyaskn.tripod.com/sql_archive_data.htm




[quoted text, click to view]

AddThis Social Bookmark Button