In yesterdays post on encountering an error deploying the Fastpath Audit Trails to a new company, there was a problem which came up, but I forgot to mention.
When the minimum permissions script (also know as the hybrid grant script) from Fastpath was run, an error in SSMS was produced which was not seen when implementing:
Msg 3729, Level 16, State 1, Procedure sp_revokedbaccess, Line 51 [Batch Start Line 18] Cannot drop schema 'Fastpathsql' because it is being referenced by object 'GP_DR_AT_BankDetailChanges'.
The problem here was because we had created a report via the portal and this had the owner of the SQL login configured for use by Audit Trails. The solution is to change the database owner to dbo.
This can be done a few ways, but the “safest” is to use the
sp_changeobjectowner stored procedure to alter the owner to dbo:
EXEC dbo.sp_changeobjectowner @objname = 'Audit Trails SQL Login.SQL view name', @newowner = 'dbo'
The two highlighted sections need to be replaced; the first with the current owner of the view, the second is the view name.