Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
JKW  
#1 Posted : Tuesday, December 5, 2017 12:44:50 PM(UTC)
JKW
Rank: Advanced Member

Reputation:

Groups: Registered
Posts: 79

Folks, 

When we updated the SQL SERVER database the other day, ESdat chose to create a WELL record for every SAMPLE that had the Well field  populated. However - given that the default value for the Well field in Samples is '-' - EVERY normal sample got a well record 0 - whether it was a Water sample or not. 

Now we have all these non existent Wells for soil samples that need deleting.  Purely as a byproduct of the SAMPLE table always getting Well Field info due to default value. 

I've isolated the WELL records that we want to delete and have a Delete Query ready to run in SSMS. However i keep hitting into the "Msg 50000, Level 16, State 1, Procedure Wells_Change_Tracker_Delete_Log, Line 12 [Batch Start Line 0] Deletions Require a Comment" ie the Table trigger stopping it issue. 

I cant Disable the Tigger temporarily in SSMS - Any thoughts on the simplest method to do this mass record delete? Turn off trigger somehow ? Then enable again?

Many thanks!

JKW

JKW  
#2 Posted : Tuesday, December 5, 2017 11:03:54 PM(UTC)
JKW
Rank: Advanced Member

Reputation:

Groups: Registered
Posts: 79

I ended up solving it via 

Disable Trigger dbo.Wells_Change_Tracker_Delete_Log On dbo.Wells

Then rerunning deleteion and enabling trigger again

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.