Search

Action_id fails in AUDIT predicate if string specified by Bob Beauchemin

Active

1
0
Sign in
to vote
Type: Bug
ID: 710424
Opened: 12/1/2011 6:13:04 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
SQL Server 2012 predicates (WHERE clause in CREATE SERVER AUDIT) does NOT work if action_id is specified as a string. It does work if action_id is specified as a number. This is incorrect because action_id is defined as char(4) in the description of the audit record (see http://msdn.microsoft.com/en-us/library/cc280545(v=SQL.110).aspx) and as char(4) in sys.dm_audit_actions.

If you really are using numbers for action_id (I really don't see this anywhere, but maybe internally?) these should be documented.
Details (expand)

Product Language

English

Version

SQL Server 2012 RC0

Category

SQL Engine

Operating System

Windows Server 2008 R2 Standard

Operating System Language

US English

Steps to Reproduce

Define a SERVER AUDIT with a predicate like:

CREATE SERVER AUDIT foo
...WHERE action_id = 'G' -- this fails, and should work

CREATE SERVER AUDIT foo
...WHERE action_id = 4 -- this works, and should fail

Actual Results

See steps to reproduce, above.

Expected Results

See steps to reproduce, above.

Platform

X64
File Attachments
0 attachments
Sign in to post a comment.
Posted by Bob Beauchemin on 12/5/2011 at 11:31 AM
Hi Don,

Does you answer mean that action_id CANNOT be specified on a SERVER AUDIT predicate? If it CAN'T, the error message, the error message is wrong/misleading too. The error message is:

Msg 25713, Level 16, State 23, Line 1
The value specified for event attribute or predicate source, "action_id", event, "audit_event", is invalid.

If it CAN be specified, without the numeric action_id string-to-number conversion is required to use the feature. I'm guessing that's what your answer means.

Action_id is doc'd as CHAR(4) in two places in the docs, and VARCHAR(4) in one place. Never doc'd (or displayed) as numeric.
Posted by Microsoft on 12/5/2011 at 10:59 AM
Hi Bob,

Thanks for your continued feedback on the product!

We will get the documentation addressed for this topic.

Thank you and regards,
Don Pinto
SQL Server Engine
Sign in to post a workaround.