Friday, June 1, 2012

SQL AUDIT TASK Table Script

To create a table for AUDIT TASK function. Script with drop and create.


USE [Work]  --DB Name
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[AuditTask]') AND type in (N'U'))
DROP TABLE [dbo].[AuditTask]


USE [Work]  DB Name
GO
CREATE TABLE [dbo].[AuditTask](
[AuditTaskId] [bigint] IDENTITY(1,1) NOT NULL,
[AuditId] [bigint] NOT NULL,
[Status] [varchar](50) NULL,
[StartTime] [datetime] NULL,
[EndTime] [datetime] NULL,
[PackageName] [varchar](100) NULL,
[TaskName] [varchar](100) NULL,
[TableName] [varchar](50) NULL,
[RowsAffected] [int] NULL,
[UserName] [varchar](100) NULL,
[VersionBuild] [int] NULL,
[MachineName] [varchar](100) NULL,
[LastModDate] [datetime] NULL
) ON [PRIMARY]


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.