Server Logon Trigger fails after deleting many records in "Logon-Table" -SQL Error 2801
From a logging perspective, if you intend to delete more than 50% of the rows from a table, you should use the following methodology:


Set the transaction isolation level to serializable
Begin a transaction
Create a new table, named the same as the original table, with a _x
suffix
Copy the results you want to keep from the original table to the _x
one
Drop the original table
Rename the _x table back to the original table
Commit the transaction


Also, the PK_ID column that you described should be the PK and clustred index for the table, otherwise its just a heap.

Also, in terms of logging server logins, perhaps you'd have better luck using an Audit or extended event session?

The "The definition of object ‘my_proc’ has changed since it was compiled" error that you described should be resolvable by calling sp_recompile.