.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SQL Audit: What operations are captured within DATABASE_OBJECT_ACCESS_GROUP?

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
What operations are captured in DATABASE_OBJECT_ACCESS_GROUP? I expected create/drop certificate/symmetric key is captured. But nothing is captured after I followed these steps: CREATE DATABASE DB1, Configure and enable Server and Database Audit Specs which includes (only) DATABASE_OBJECT_ACCESS_GROUP (in both Specs). Then execute the following T-SQL Script.   USE DB1 GO CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'P@ssw0rd!' GO CREATE CERTIFICATE MyDBCert WITH SUBJECT = 'My Database Certificate' GO CREATE SYMMETRIC KEY MySymKey WITH ALGORITHM = TRIPLE_DES ENCRYPTION BY CERTIFICATE MyDBCert GO CREATE TABLE T1 (ID nvarchar(3), C1 nvarchar(50)) GO -------------------------------------------------------------- OPEN SYMMETRIC KEY MySymKey DECRYPTION BY CERTIFICATE MyDBCert DECLARE @I INT SET @I = 100 WHILE @I <> 0 BEGIN INSERT INTO T1(ID) VALUES(@I) SET @I = @I -1 END GO -------------------------------------------------------------- UPDATE T1 SET C1 = EncryptByKey(Key_GUID('MySymKey'),ID) OPEN SYMMETRIC KEY MySymKey DECRYPTION BY CERTIFICATE MyDBCert SELECT ID, C1, CONVERT(nvarchar, DECRYPTBYKEY(C1)) FROM T1 GO -------------------------------------------------------------- DROP TABLE T1 GO DROP SYMMETRIC KEY MySymKey GO DROP CERTIFICATE MyDBCert GO DROP MASTER KEY GO

View Complete Post

More Related Resource Links

How to Perform SQL Server Row-by-Row Operations Without Cursors

SQL cursors have been a curse to database programming for many years because of their poor performance. On the other hand, they are extremely useful because of their flexibility in allowing very detailed data manipulations at the row level. Using cursors against SQL Server tables can often be avoided by employing other methods, such as using derived tables, set-based queries, and temp tables

Audit Trail


In my MySql Table I need to keep track of all the changes, especially create,update, and delete changes each record. I need to keep track of who did
what changes.

This is MySQL Create table Query

create table quotes(QuoteNumber int(15) ,Revision timestamp,Vendor varchar(45),
PartNumber varchar(60),Status varchar(20),Customer varchar(45),
Requestor varchar(20),X varchar(20),Xin varchar(10),Y varchar(20),Yin varchar(10),Layers Varchar(20),
BlindVia varchar(20),Impedence varchar(20))

How can i implement the Audit trail to above table.Please help me,Thanks.

.NET Matters: Parallelizing Operations With Dependencies


In this month's installment, Stephen Toub examines some techniques for enforcing dependencies in the running order of asynchronous operations and builds a DependencyManagement class to help.

Stephen Toub

MSDN Magazine April 2009

ASP.NET Workflow: Web Apps That Support Long-Running Operations


Integrating workflow into ASP.NET applications means communicating with activities via a workflow queue and hosting the runtime in the global application class. We'll show you how.

Michael Kennedy

MSDN Magazine January 2009

Toolbox: Database Audit Logs, Joel on Software, Code Handouts, and More


This month the Toolbox column takes a look at database logging, Joel Spolsky's blog, printing code projects, and ASP.NET reading.

Scott Mitchell

MSDN Magazine May 2008

Concurrent Affairs: Asynchronous Device Operations


Jeff Richter uses the AsyncResult class to implement the CLR's Asynchronous Programming Model to perform hardware device operations asynchronously.

Jeffrey Richter

MSDN Magazine June 2007

Stay Alert: Use Managed Code To Generate A Secure Audit Trail


In today's security-conscious environments, a reliable audit trail is a valuable forensic tool The Windows Server 2003 operating system provides features that let you enable a wide range of applications to make use of auditing functionality. This article looks at auditing from the operating system perspective and describes a sample managed code implementation that will allow you to add auditing to your own server applications.

Mark Novak

MSDN Magazine October 2005

Visual Studio 2005: Bridge the Gap Between Development and Operations with Whitehorse


Microsoft is introducing a new suite of tools (code-named "Whitehorse") that will make it easier for you to design and implement systems that conform to a service-oriented architecture. Two of these tools -- the SOA Design Suite and the Class Designer -- support the graphical design of systems and components with support for code generation and support for bi-directional synchronization which lets you ensure that your diagram always represents your system design. This article introduces these tools and shows you how they'll improve your design and development efforts.

Brian A. Randell and Rockford Lhotka

MSDN Magazine July 2004

Data Points: Creating Audit Tables, Invoking COM Objects, and More


Dealing with error handling between T-SQL and a calling application, evaluating when a field's value has changed, and creating auditing tables in SQL ServerT are all common issues that developers must tackle.

John Papa

MSDN Magazine April 2004

Bulk Copy Operations in ADO.NET 2.0


Bulk copying of data from one data source to another data source is a new feature added to ADO.NET 2.0. Bulk copy classes provides the fastest way to transfer set of data from once source to the other.

Each ADO.NET data provider provides bulk copy classes. For example, in SQL .NET data provider, the bulk copy operation is handled by SqlBulkCopy class, which is described in Figure 1. As you can see from Figure 1, data from a data source can be copied to one of the four types - DataReader, DataSet, DataTable, or XML.

An operations error occurred in ActiveDirectoryMembershipProvider


Hi guys, i have an application that uses Active Directory Authentication and deployed the application several days ago without any error. Today, I got this error.please refer to the image. I find it  weird because I didn't change any code to my webconfig file since i deployed the application to the server. I've notice that it's working if it's http://localhost:50618/website/login.aspx (by opening the source file in server and debug it) however when i try to access the application through I'm getting this error. I'm using 2.0 framework

And here's my web.config

        <add name="ADConnectionString" connectionString="LDAP://,DC=com"/>

 <identity impersonate="true"/>
        <membership defaultProvider="MyADMembershipProvider">
                <add name="MyADMembershipProvider" 
                type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=,               Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 

Video: Sandboxed Operations in SharePoint 2010

This video provides an overview of the operations that are allowed in sandboxed solutions. (Length: 2:39)

Can't perform Create, Update or Delete operations on 'Table(outbox)' because it has no primary ke



I'm a beginner in asp.net and I have some problem inserting data into sql server 2005 with linq.


my code is : 


        Dim Result As New SMS.SendResult
        If Result.status = 0 Then
            Label1.Text = "Your Message Sent Successfuly"
            Dim db As New IGSSDataContext
            Dim out As New outbox With {.ClientID = intRandomNumber, .From = User.Identity.Name, .TO = TextBox1.TabIndex, _
            .Time = Now, .Message = Message}
            out.ID = (ID)
            TextBox1.Text = ""

Implementation of Audit Fields and optimistic concurrency

What is the best way to implement Optimistic concurrency? Also, I have 4 audit columns in every table in my database. They are created date, updated date, created by, updated by. Application should populate these fields. I want to know how to populate created date , and updated date? From where application datetime or database datetime? On save button click, if I have to save data into 4 different tables, then I need to have same datetime in all 4 audit fields correct? What is the best way to implement this? What will be the design? Please let me know.  

Generic Audit Trigger CLR C#(Works when the trigger is attached to any Table)

This Audit Trigger is Generic (i.e. non-"Table Specific") attach it to any tabel and it should work.  Be sure and create the 'Audit' table first though. The following code write audit entries to a Table called'Audit' with columns 'ActionType'    //varchar'TableName'    //varchar'PK'    //varchar'FieldName'    //varchar'OldValue'    //varchar'NewValue'    //varchar'ChangeDateTime'    //datetime'ChangeBy'    //varchar using System;using System.Data;using System.Data.SqlClient;using Microsoft.SqlServer.Server; public partial class Triggers{//A Generic Trigger for Insert, Update and Delete Actions on any Table[Microsoft.SqlServer.Server.SqlTrigger(Name = "AuditTrigger", Event = "FOR INSERT, UPDATE, DELETE")] public static void AuditTrigger(){SqlTriggerContext tcontext = SqlContext.TriggerContext; //Trigger Contextstring TName; //Where we store the Altered Table's Namestring User; //Where we will store the Database UsernameDataRow iRow; //DataRow to hold the inserted valuesDataRow dRow; //DataRow to how the deleted/overwritten valuesDataRow aRow; //Audit DataRow to build our Audit entry withstring PKString; //Will temporarily store the Primary Key Column Names and Values hereusing (SqlConnection conn = new SqlConnection("context connection=true"))//Our Connection{conn.Open();//Open the Connection//Build the AuditAdapter an
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend