Displays the status of audit options.
sp_displayaudit ["procedure" | "object" | "login" | "database" | "global" | "default_object" | "default_procedure" [, "name"]]
You cannot specify a value for name unless you first specify an object type parameter.
sp_displayaudit
Procedure/Trigger Audit Option Value Database ----------------- -------------- ----- --------------------- dbo.sp_altermessage exec_procedure on sybsystemprocs dbo.sp_help exec_procedure on sybsystemprocs dbo.sp_who exec_procedure on sybsystemprocs No databases currently have default sproc/trigger auditing enabled. No objects currently have auditing enabled. No databases currently have default table/view auditing enabled. No logins currently have auditing enabled. No databases currently have auditing enabled. Option Name Value ------------------------------ ------------------------------ adhoc off dbcc off disk off errors off login off logout off keycustodian_role off navigator_role off oper_role off replication_role off rpc off sa_role off security off sso_role off
sp_displayaudit "procedure"
Procedure/Trigger Audit Option Value Database ----------------- -------------- ----- --------------------- dbo.sp_altermessage exec_procedure on sybsystemprocs dbo.sp_help exec_procedure on sybsystemprocs dbo.sp_who exec_procedure on sybsystemprocs
sp_displayaudit "procedure", "sp_who"
Procedure/Trigger Audit Option Value Database ----------------- --------------- ----- ---------------------- dbo.sp_who exec_procedure on sybsystemprocs
sp_displayaudit "global"
Option Name Value ------------------------------ ------------------------------ adhoc off dbcc off disk off errors off login off logout off keycustodian_role off navigator_role off oper_role off replication_role off rpc off sa_role off security off sso_role off
Object Type Parameter | Valid Auditing Options |
---|---|
procedure | exec_procedure, exec_trigger |
object | delete, func_obj_access, insert, reference, select, update |
login | all, cmdtext, table_access, view_access |
database | alter, bcp, bind, create, dbaccess, drop, dump, encryption_key, func_dbaccess, grant, load, revoke, setuser, truncate, unbind |
global | adhoc, dbcc, disk, errors, login, logout, navigator_role, oper_role, replication_role, rpc, keycustodian_role, sa_role, security, sso_role |
default_object | delete, func_obj_access, insert, reference, select, update |
default_procedure | exec_procedure, exec_trigger |
See the System Administration Guide for information on setting up auditing.
bcp in the Utility Guide
The permission checks for sp_displayaudit differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be a user with manage auditing privilege. |
Disabled | With granular permissions disabled, you must be a user with sso_role. |
Values in event and extrainfo columns from the sysaudits table are:
Information | Values |
---|---|
Event | 38 |
Audit option | exec_procedure |
Command or access audited | Execution of a procedure |
Information in extrainfo |
|