/***** The following script may be used to create the required tables in Microsoft MSSQL server *****/

/***** Create log table *****/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[record_date] [datetime] NOT NULL,
	[server_ip] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[server_port] [int] NULL,
	[client_ip] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[client_port] [int] NULL,
	[session_id] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[username] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[client_request] [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[client_message] [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[server_status] [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[inbound_bytes] [bigint] NULL,
	[outbound_bytes] [bigint] NULL,
	[server_message] [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
 CONSTRAINT [PK_log] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
