Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

10775: audit specification

Posted on 2015-02-17
2
Medium Priority
?
68 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 1000 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 52

Accepted Solution

by:
Vitor Montalvão earned 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

916 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