if exists (select * 
from INFORMATION_SCHEMA.VIEWS
where table_name = 'T_AUTHENTICATION_AUDIT')
begin
	DROP VIEW [VCLib].[T_AUTHENTICATION_AUDIT]

	CREATE TABLE [VCLib].[T_AUTHENTICATION_AUDIT]
	(
		[AuthenticationAuditID] uniqueidentifier NOT NULL,
		[RegisterTime] datetime NOT NULL,
		[UnregisterTime] datetime NULL,
		[ComputerName] varchar(100) NOT NULL,
		[Ip] varchar(40) NOT NULL,
		[Login] varchar(50) NOT NULL,
		[ServerSessionId] uniqueidentifier NULL,
		[RemoteDomain] varchar(256) NULL,
		[RemoteIp] varchar(32) NULL,
		[RemoteComputerName] varchar(256) NULL,
		[RemoteUserName] varchar(256) NULL,
		[RegisterType] int NOT NULL,
		[UnregisterType] int NULL,
		[AuthenticationType] int NOT NULL
	)
	ON [PRIMARY]

	ALTER TABLE [VCLib].[T_AUTHENTICATION_AUDIT] ADD CONSTRAINT [PK_T_AUTHENTICATION_AUDIT]
	PRIMARY KEY CLUSTERED ([AuthenticationAuditID]) ON [PRIMARY]

end