Is there some exec command to remove autoAudit from a table? Or just deleting the triggers is how to do that? I actually don't care about any history data that I have, as I'm still in development and test on a particular table.
There seems to be an issue as described here: https://stackoverflow.com/questions/76863100/false-error-cannot-find-the-object-table-because-it-does-not-exist-or-you-do#76863100. This happens when using the SSMS designer to add a column in the middle of the existing columns (as opposed new columns at the end of the existing columns).
The error shown in the designer is misleading:
"Cannot find the object "xxxxx" because it does not exist or you do not have permissions."
I created the script from the designer as recommended in one of the comments, and it show this:
Dropping AutoAudit components from table: [dbo].[Ch_BizTalk_Email_DistList]
Dropping Table Audit DDL
Msg 4902, Level 16, State 1, Line 67
Cannot find the object "dbo.Ch_BizTalk_Email_DistList" because it does not exist or you do not have permissions.
Msg 15248, Level 11, State 1, Procedure sp_rename, Line 419 [Batch Start Line 68]
Either the parameter @OBJName is ambiguous or the claimed @objtype (OBJECT) is wrong.
Msg 1779, Level 16, State 0, Line 71
Table 'Ch_BizTalk_Email_DistList' already has a primary key defined on it.
Msg 1750, Level 16, State 0, Line 71
Could not create constraint or index. See previous errors.
Msg 2714, Level 16, State 2, Procedure Ch_BizTalk_Email_DistList_Audit_Insert, Line 1 [Batch Start Line 77]
There is already an object named 'Ch_BizTalk_Email_DistList_Audit_Insert' in the database.
Msg 2714, Level 16, State 2, Procedure Ch_BizTalk_Email_DistList_Audit_Update, Line 1 [Batch Start Line 231]
There is already an object named 'Ch_BizTalk_Email_DistList_Audit_Update' in the database.
Msg 2714, Level 16, State 2, Procedure Ch_BizTalk_Email_DistList_Audit_Delete, Line 1 [Batch Start Line 543]
There is already an object named 'Ch_BizTalk_Email_DistList_Audit_Delete' in the database.
Msg 2714, Level 16, State 2, Procedure Ch_BizTalk_Email_DistList_trgAfterUpdate, Line 1 [Batch Start Line 682]
There is already an object named 'Ch_BizTalk_Email_DistList_trgAfterUpdate' in the database.
Msg 3902, Level 16, State 1, Line 697
The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.
Msg 2714, Level 16, State 5, Line 700
There is already an object named 'FK_Ch_BizTalk_Email_DistListCh_BizTalk_Email_Event' in the database.
Msg 1750, Level 16, State 1, Line 700
Could not create constraint or index. See previous errors.
Msg 3902, Level 16, State 1, Line 713
The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.
Thanks,
Neal