Home Forums Programming Service Broker Want to create a service broker broker application for auditing my databse RE: Want to create a service broker broker application for auditing my databse

  • Hi,

    Let me make myself clear.

    I have a table with below table structure. It will just maintain the information that on which table with what primary(with its value) does the change occurred on what type(insert, update, delete) with old value of the column on which change occur and the new value of the column with added information about who made the changes and at what time?

    Table Structure:

    CREATE TABLE [dbo].[DataAudit](

    [Pk_RowID] [int] IDENTITY(1,1) NOT NULL,

    [AuditID] [int] NOT NULL,

    [Type] [nchar](1) NULL,

    [TableName] [nvarchar](128) NULL,

    [PrimaryKeyField] [nvarchar](1000) NULL,

    [PrimaryKeyValue] [nvarchar](1000) NULL,

    [FieldName] [varchar](128) NULL,

    [OldValue] [varchar](max) NULL,

    [NewValue] [varchar](max) NULL,

    [UsrID] [varchar](20) NULL,

    [Udt] [datetime] NULL,

    [BusinessDt] [datetime] NULL,

    [ConcurrencyID] [timestamp] NOT NULL,

    PRIMARY KEY CLUSTERED

    (

    [AuditID] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

    ) ON [PRIMARY]