Solved

10775: audit specification

Posted on 2015-02-17
2
61 Views
Last Modified: 2015-02-21
i have this code

CREATE DATABASE AUDIT SPECIFICATION MarketingSelectSpec
  FOR SERVER AUDIT MarketDevLog
  ADD (SELECT ON SCHEMA::[HumanResources] BY public);
GO

What should I change to audit:
[HumanResources] [Employee] specifically columns. [NationalIDNumber] and [ContactID]
0
Comment
Question by:enrique_aeo
2 Comments
 
LVL 28

Assisted Solution

by:Ryan McCauley
Ryan McCauley earned 250 total points
ID: 40620419
I took a look at MSDN (read here for more details on the command) and it looks like you can change the audit specification to monitor just a single table rather than the whole schema by changing the ADD line from:

ADD (SELECT ON SCHEMA::[HumanResources] BY public);

to:

ADD (SELECT ON object::[HumanResources].[Employee] BY public);

In this case, you're changing the "class" of object to be audited from "schema" to "object" for just that single table.
0
 
LVL 47

Accepted Solution

by:
Vitor Montalvão earned 250 total points
ID: 40620945
Why don't you use the CHANGE TRACKING feature?
ALTER TABLE [HumanResources].[Employee] 
ENABLE CHANGE_TRACKING WITH (TRACK_COLUMNS_UPDATED = ON)

Open in new window

NOTE: You may need to enable change tracking for the database. In SSMS do that in the database properties.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
insert wont work in SQL 14 22
Deal with apostrophe in stored procedures 8 43
Passing Parameter to Stored Procedure 4 24
sql how to count case when 4 18
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question