Unix Technical Forum

Problem unauthorize deleting of primary key in SQL

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. ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 04:34 AM
dev@euro-consult.dk
 
Posts: n/a
Default Problem unauthorize deleting of primary key in SQL

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 04:34 AM
Simon Hayes
 
Posts: n/a
Default Re: Problem unauthorize deleting of primary key in SQL


<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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:30 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com