This is a discussion on Problem unauthorize deleting of primary key in SQL within the SQL Server forums, part of the Microsoft SQL Server category; --> Hej There. We have a big problem. We have now for 4th years had a SQL Server without problems. ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hej There. We have a big problem. We have now for 4th years had a SQL Server without problems. But sutnely some of the primary keys are deleted. The subdata to the primary keys are not deleted. This is a big problem because This is a billing system. Recently there was over 300 primay keys deleted. Good that we have backup but still... NOOOT good Can anyone help me to solve this problem!!! PLEASE Best regards Danni |
| ||||
| <dev@euro-consult.dk> wrote in message news:d3706e7e.0407120430.13e66f6f@posting.google.c om... > Hej There. > > We have a big problem. We have now for 4th years had a SQL Server > without problems. But sutnely some of the primary keys are deleted. > The subdata to the primary keys are not deleted. This is a big problem > because This is a billing system. Recently there was over 300 primay > keys deleted. Good that we have backup but still... NOOOT good > > Can anyone help me to solve this problem!!! PLEASE > > Best regards > > Danni I'm not entirely sure whether you mean that 300 primary key constraints were dropped, or that 300 rows in a table were deleted (rows, I guess). Either way, the most obvious question is what changed? Did you roll out a new version of a client application, for example? Or are there any new users with DELETE permissions in the database? If you have transaction log backups, you might be able to find out when the rows were deleted and by whom with a third-party tool such as this one: http://www.lumigent.com/products/le_sql.html If not, then there's probably no good way to find out how this happened after the event. You say that the "subdata" were not deleted - do you mean the 'child' data in the referencing tables? If so, then adding foreign keys (which you should have anyway) will prevent referenced primary key values being deleted. Apart from that, you may want to review your current permissions, and perhaps consider running a trace on all DELETE statements in the database for a while if you're worried about this happening again (and if there's no performance problem with doing that). Or you could create your own audit triggers to capture information about deletions. Simon |