Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Deleted Records

Author  Topic 

vna_mhars
Starting Member

37 Posts

Posted - 2010-12-28 : 00:28:05
Hi,

I have MSSQL2000 server, one of my users told us that there is a missing records, I want to know if there's someone deleted the records or not.

is there a tools or possibilities to trace the person deleted the records? the report says that it was found out last Dec 24 that there is a missing record.. It is only happened in 1 table. My last Backup is Dec 24 midnight, it means delete was already done ..

Regards,



vamodente

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-12-28 : 05:13:30
Not unless you had a trace or an audit trigger in place at the time the deletion occurred.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

vna_mhars
Starting Member

37 Posts

Posted - 2010-12-28 : 20:11:08
Is it possible to put a trigger in a table even it is already existing and has lots of records.? so that the next time it happens "hopefully not" I have audit log.

thanks,

vamodente
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2010-12-28 : 20:17:58
yes

create trigger xxxx on tbl for delete
as
insert tbldelau
select d.*, getdate(), user_name()
from deleted d


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

vna_mhars
Starting Member

37 Posts

Posted - 2010-12-28 : 22:19:55
Thanks Guys, you did a great help for me ..

vamodente
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-12-29 : 09:51:17
Splitting hairs a bit, but personally we do

insert tbldelau
select getdate(), user_name(), d.*
from deleted AS d

which makes the [tbldelau] a bit easier to manage if new columns are added to the parent [tbl] table.
Go to Top of Page
   

- Advertisement -