I'm trying to ADD CREATE and DROP commands to an existing SERVER AUDIT.
When executing the following statement :
ALTER DATABASE AUDIT SPECIFICATION Powercash_Audit
FOR SERVER AUDIT PowercashAudit
ADD (CREATE, DROP ON SCHEMA::dbo BY PUBLIC)
WITH (STATE = ON);
GO
I've got the following error :
Msg 102, Level 15, State 1, Line 38
Incorrect syntax near 'CREATE'."
I didn't fix it yet, any ideas ?
Thanks in advance, Alex
1条答案
按热度按时间h22fl7wq1#
In SQL Server, the
CREATE
andDROP
actions cannot be directly added to a server-level audit specification. These actions are only applicable at the database level. Therefore, you need to modify your script to create a database-level audit specification and associate it with the desired server-level audit.