By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,003 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Records getting deleted mysteriously..

P: n/a
I'm running a DB using MSDE (2000) that is interfaced by 2 different
ades running on PCs with Access 2000 Runtime. One of the ADEs is a
package accounting system that is very solid and stable, the other is
a custom application that I wrote (much less solid and stable). The
custom app only deals with a select few tables in the database, and
the table in question is not one of those.
With alarming regularity(daily), records are getting deleted out of a
particular table. I've set up a couple of dummy records in the table
and put a delete trigger on the table that creates record in a 'log'
table that tells me the user and the time that the records are
deleted.
The deletion (all records in the table) always occurs during business
hours (never over the weekend or at night) and the user responsible
varies among 3 or 4 different users. 2 of those users don't even have
rights to that table, so I'm really confused how those logins could
cause a delete on the table they don't have access to!??!
As far as I can tell, this is only happening to this particular table
( I hope!).
Is there a way that I can get more information on the process or
machine or anything else that is behind the deletion?
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi

Check out any stored procedures to see if the they will delete them as the
ownership chain may allow them to access the table. You may also want to
check for any FKs with cascading deletes.

Usually I would profile this to get an overall view of what activity is
occuring.

John

"C Kirby" <ck****@mindspring.com> wrote in message
news:ru********************************@4ax.com...
I'm running a DB using MSDE (2000) that is interfaced by 2 different
ades running on PCs with Access 2000 Runtime. One of the ADEs is a
package accounting system that is very solid and stable, the other is
a custom application that I wrote (much less solid and stable). The
custom app only deals with a select few tables in the database, and
the table in question is not one of those.
With alarming regularity(daily), records are getting deleted out of a
particular table. I've set up a couple of dummy records in the table
and put a delete trigger on the table that creates record in a 'log'
table that tells me the user and the time that the records are
deleted.
The deletion (all records in the table) always occurs during business
hours (never over the weekend or at night) and the user responsible
varies among 3 or 4 different users. 2 of those users don't even have
rights to that table, so I'm really confused how those logins could
cause a delete on the table they don't have access to!??!
As far as I can tell, this is only happening to this particular table
( I hope!).
Is there a way that I can get more information on the process or
machine or anything else that is behind the deletion?

Jul 20 '05 #2

P: n/a
C Kirby (ck****@mindspring.com) writes:
The deletion (all records in the table) always occurs during business
hours (never over the weekend or at night) and the user responsible
varies among 3 or 4 different users. 2 of those users don't even have
rights to that table, so I'm really confused how those logins could
cause a delete on the table they don't have access to!??!
As far as I can tell, this is only happening to this particular table
( I hope!).
Is there a way that I can get more information on the process or
machine or anything else that is behind the deletion?


In addition to John's suggestion, here are a few more tips of what you
could put in the log table:

o The value of @@nestlevel. If the value is 1, the trigger was fired from
an explicit DELETE statement. If the value is 2, the trigger may have
been fired from a direct DELETE statement in a stored procedure, or
from another trigger.
o INSERT #tbl EXEC('DBCC INPUTBUFFER (' + ltrim(str(@@spid)) +
') WITH TABLE_RESULTS')
This will give you the command the user/application submitted. Look
up DBCC INPUTBUFFER in Books Online for details on the result set.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.