-- Licensed Materials - Property of IBM
-- IBM Cognos Products: ccllogging
-- (C) Copyright IBM Corp. 2011
-- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 


sp_rename 'COGIPF_USERLOGON', 'COGIPF_USERLOGON_OLD'

CREATE TABLE COGIPF_USERLOGON (
	COGIPF_HOST_IPADDR 	varchar (128) NULL ,
	COGIPF_HOST_PORT 	int NULL ,
	COGIPF_PROC_ID 		int NULL ,
	COGIPF_LOCALTIMESTAMP 	datetime NULL ,
	COGIPF_TIMEZONE_OFFSET 	int NULL ,
	COGIPF_SESSIONID 	varchar (255) NULL ,
	COGIPF_REQUESTID 	nvarchar (255) NOT NULL ,
	COGIPF_STEPID 		nvarchar (255) NULL ,
	COGIPF_SUBREQUESTID 	nvarchar (255) NULL ,
	COGIPF_THREADID 	varchar (255) NULL ,
	COGIPF_COMPONENTID 	varchar (64) NULL ,
	COGIPF_BUILDNUMBER 	int NULL ,
	COGIPF_LOG_LEVEL 	int NULL ,
	COGIPF_STATUS 		varchar (255) NULL ,
	COGIPF_ERRORDETAILS 	nvarchar (2000) NULL ,
	COGIPF_LOGON_OPERATION 	varchar (255) NULL ,
	COGIPF_USERNAME 	nvarchar (255) NULL ,
	COGIPF_USERID 		nvarchar (255) NULL ,
	COGIPF_NAMESPACE 	nvarchar (255) NULL, 
	COGIPF_REMOTE_IPADDR 	varchar (128) NULL,
	COGIPF_CAMID		nvarchar (512) NULL,
	COGIPF_TENANTID 	nvarchar (255) NULL default ''
	)

insert into COGIPF_USERLOGON (COGIPF_HOST_IPADDR,COGIPF_HOST_PORT,COGIPF_PROC_ID,COGIPF_LOCALTIMESTAMP,COGIPF_TIMEZONE_OFFSET,COGIPF_SESSIONID,COGIPF_REQUESTID,COGIPF_STEPID,COGIPF_SUBREQUESTID,COGIPF_THREADID,COGIPF_COMPONENTID,COGIPF_BUILDNUMBER,COGIPF_LOG_LEVEL,COGIPF_STATUS,COGIPF_ERRORDETAILS,COGIPF_LOGON_OPERATION,COGIPF_USERNAME,COGIPF_USERID,COGIPF_NAMESPACE,COGIPF_REMOTE_IPADDR,COGIPF_CAMID) select  * from COGIPF_USERLOGON_OLD

drop table COGIPF_USERLOGON_OLD


