Solved

10775: audit specification

Posted on 2015-02-17
2
62 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 48

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

792 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