ÿþ

/****** Object:  Table [dbo].[SMS_MO]    Script Date: 03/28/2011 10:41:37 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo].[SMS_MO](

	[GUID] [varchar](50) NOT NULL,

	[MSGID] [varchar](50) NULL,

	[UP_TIME] [datetime] NULL,

	[LONG_SERV_NO] [varchar](50) NULL,

	[SERV_CODE] [varchar](50) NULL,

	[MOBILE_NO] [varchar](50) NULL,

	[MOBILE_NO_TYPE] [char](1) NULL,

	[SMS_CONTENT] [varchar](160) NULL,

	[LINK_ID] [varchar](50) NULL,

	[OUT_GATEWAY_ID] [varchar](50) NULL,

 CONSTRAINT [PK_SMS_MO] PRIMARY KEY CLUSTERED 

(

	[GUID] ASC

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

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

GO



/****** Object:  Table [dbo].[SMS_REPORT_WAIT]    Script Date: 03/28/2011 10:41:37 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo].[SMS_REPORT_WAIT](

	[GUID] [varchar](50) NOT NULL,

	[MSGID] [varchar](50) NULL,

	[MOBILE_NO] [varchar](21) NULL,

	[MOBILE_NO_TYPE] [char](1) NULL,

	[REPORT_SUCCESS] [char](1) NULL,

	[REPORT_TIME] [datetime] NULL,

	[REPORT_STAT] [varchar](20) NULL

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

GO

/****** Object:  Table [dbo].[SMS_MT_TEL_WAIT]    Script Date: 03/28/2011 10:41:37 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo].[SMS_MT_TEL_WAIT](

	[GUID] [varchar](50) NOT NULL,

	[DOWN_TIME] [datetime] NULL,

	[LONG_SERV_NO] [varchar](21) NOT NULL,

	[SERV_CODE] [varchar](10) NOT NULL,

	[MOBILE_NO] [varchar](50) NOT NULL,

	[MOBILE_NO_TYPE] [char](1) NOT NULL,

	[FEE_TYPE] [varchar](50) NOT NULL,

	[FEE] [varchar](10) NOT NULL,

	[SMS_CONTENT] [varchar](140) NOT NULL,

	[LINK_ID] [varchar](20) NULL,

	[OUT_GATEWAY_ID] [varchar](20) NULL,

	[WAPURL] [varchar](255) NULL,

	[MSGSUM] [int] NULL,

	[MSGSUB] [int] NULL

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

GO

/****** Object:  Table [dbo].[SMS_MT_CU_WAIT]    Script Date: 03/28/2011 10:41:37 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo].[SMS_MT_CU_WAIT](

	[GUID] [varchar](50) NOT NULL,

	[DOWN_TIME] [datetime] NULL,

	[LONG_SERV_NO] [varchar](21) NOT NULL,

	[SERV_CODE] [varchar](10) NOT NULL,

	[MOBILE_NO] [varchar](50) NOT NULL,

	[MOBILE_NO_TYPE] [char](1) NOT NULL,

	[FEE_TYPE] [varchar](50) NOT NULL,

	[FEE] [varchar](10) NOT NULL,

	[SMS_CONTENT] [varchar](140) NOT NULL,

	[LINK_ID] [varchar](20) NULL,

	[OUT_GATEWAY_ID] [varchar](20) NULL,

	[WAPURL] [varchar](255) NULL,

	[MSGSUM] [int] NULL,

	[MSGSUB] [int] NULL

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

GO

/****** Object:  Table [dbo].[SMS_MT_CM_WAIT]    Script Date: 03/28/2011 10:41:37 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo].[SMS_MT_CM_WAIT](

	[GUID] [varchar](50) NOT NULL,

	[DOWN_TIME] [datetime] NULL,

	[LONG_SERV_NO] [varchar](21) NOT NULL,

	[SERV_CODE] [varchar](10) NOT NULL,

	[MOBILE_NO] [varchar](50) NOT NULL,

	[MOBILE_NO_TYPE] [char](1) NOT NULL,

	[FEE_TYPE] [varchar](50) NOT NULL,

	[FEE] [varchar](10) NOT NULL,

	[SMS_CONTENT] [varchar](140) NOT NULL,

	[LINK_ID] [varchar](20) NULL,

	[OUT_GATEWAY_ID] [varchar](20) NULL,

	[WAPURL] [varchar](255) NULL,

	[MSGSUM] [int] NULL,

	[MSGSUB] [int] NULL

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

GO

/****** Object:  Table [dbo].[SMS_MT]    Script Date: 03/28/2011 10:41:37 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo].[SMS_MT](

	[GUID] [varchar](50) NOT NULL,

	[MSGID] [varchar](50) NULL,

	[NEED_DOWN_TIME] [datetime] NULL,

	[FACT_DOWN_TIME] [datetime] NULL,

	[LONG_SERV_NO] [varchar](21) NULL,

	[SERV_CODE] [varchar](10) NULL,

	[SERV_NO] [char](8) NULL,

	[LOGIC_SERV_NO] [char](6) NULL,

	[MOBILE_NO] [varchar](21) NULL,

	[MOBILE_NO_TYPE] [char](1) NULL,

	[FEE_TYPE] [varchar](2) NULL,

	[FEE] [varchar](10) NULL,

	[SMS_FMT] [varchar](2) NULL,

	[SMS_CLENGTH] [numeric](6, 0) NULL,

	[SMS_CONTENT] [varchar](160) NULL,

	[LINK_ID] [varchar](20) NULL,

	[OUT_GATEWAY_ID] [varchar](20) NULL,

	[REPORT_STATE] [char](1) NULL,

	[REPORT_ERRCODE] [varchar](5) NULL,

	[RESERVE] [varchar](10) NULL,

	[STATUS] [numeric](1, 0) NULL,

	[OPERATOR_NO] [varchar](16) NULL,

	[SEQ_ID] [varchar](32) NULL,

	[PRECEDENCE] [varchar](3) NULL,

	[RESEND_FLAG] [varchar](3) NULL,

	[SUBSERVICE_ID] [numeric](6, 0) NULL,

	[SMS_INDEX] [numeric](2, 0) NULL,

	[INTO_TIME] [datetime] NULL,

	[REPORT] [char](1) NULL,

	[REPORT_SUCCESS] [char](1) NULL,

	[REPORT_TIME] [datetime] NULL,

	[REPORT_STAT] [varchar](20) NULL,

	[REPORT_DONWTIME] [varchar](20) NULL,

	[SUBMIT_RESULT] [numeric](4, 0) NULL,

	[SUBMIT_RESEND] [numeric](2, 0) NULL,

	[WAPURL] [varchar](255) NULL,

	[MSGSUM] [int] NULL,

	[MSGSUB] [int] NULL,

 CONSTRAINT [PK_SMS_MT] PRIMARY KEY CLUSTERED 

(

	[GUID] ASC

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

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

GO

/****** Object:  Table [dbo].[SMS_MO_WAIT]    Script Date: 03/28/2011 10:41:37 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo].[SMS_MO_WAIT](

	[ID] [numeric](18, 0) IDENTITY(1,1) NOT NULL,

	[GUID] [varchar](50) NOT NULL,

	[MSGID] [varchar](50) NULL,

	[UP_TIME] [datetime] NULL,

	[LONG_SERV_NO] [varchar](50) NULL,

	[SERV_CODE] [varchar](50) NULL,

	[MOBILE_NO] [varchar](50) NULL,

	[MOBILE_NO_TYPE] [char](1) NULL,

	[SMS_CONTENT] [varchar](160) NULL,

	[LINK_ID] [varchar](50) NULL,

	[OUT_GATEWAY_ID] [varchar](50) NULL,

 CONSTRAINT [PK_SMS_MO_WAIT] PRIMARY KEY CLUSTERED 

(

	[ID] ASC

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

) ON [PRIMARY]

GO

SET ANSI_PADDING OFF

GO

/****** Object:  Trigger [MT_InsertTrigger]    Script Date: 03/28/2011 10:41:37 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TRIGGER [dbo].[MT_InsertTrigger] 

    ON [dbo].[SMS_MT] 

    AFTER INSERT 

AS 

BEGIN 

	declare @GUID varchar(50)

	declare @DOWN_TIME Datetime

	declare @LONG_SERV_NO varchar(21)  --÷S

	declare @SERV_NO char(8)    --P[÷S

	declare @SERV_CODE varchar(10)

	declare @MOBILE_NO varchar(21)

	declare @SUB_MOBILE_NO varchar(3)

	declare @MOBILE_NO_TYPE char(1)

	declare @FEE_TYPE varchar(50)

	declare @FEE varchar(10)

	declare @SMS_CONTENT varchar(140)

	declare @LINK_ID varchar(20)

	declare @OUT_GATEWAY_ID varchar(20)

	declare @WAPURL VARCHAR(255)

	declare @MSGSUM int

	declare @MSGSUB int

	

	select @GUID=GUID,@DOWN_TIME=NEED_DOWN_TIME,@SERV_CODE=SERV_CODE,@LONG_SERV_NO=LONG_SERV_NO,@SERV_NO=SERV_NO,

	@MOBILE_NO=MOBILE_NO,@MOBILE_NO_TYPE=MOBILE_NO_TYPE,@FEE_TYPE=FEE_TYPE,@FEE=FEE,@SMS_CONTENT=SMS_CONTENT,

	@LINK_ID=LINK_ID,@OUT_GATEWAY_ID=OUT_GATEWAY_ID,@WAPURL=WAPURL ,@MSGSUM=MSGSUM,@MSGSUB=MSGSUB 

	from inserted



	if(@LONG_SERV_NO Is NULL OR  len(@LONG_SERV_NO)<=0 )

		set @LONG_SERV_NO='123456'+@SERV_NO



	set @SUB_MOBILE_NO= substring(@MOBILE_NO,1,3)



	if(@SUB_MOBILE_NO='133' OR @SUB_MOBILE_NO='153' OR @SUB_MOBILE_NO='189')

		insert into SMS_MT_TEL_WAIT(GUID,DOWN_TIME,LONG_SERV_NO,SERV_CODE,MOBILE_NO,MOBILE_NO_TYPE,FEE_TYPE,FEE,SMS_CONTENT,LINK_ID,OUT_GATEWAY_ID,WAPURL,MSGSUM,MSGSUB) 

		values(@GUID,@DOWN_TIME,@LONG_SERV_NO,@SERV_CODE,@MOBILE_NO,3,@FEE_TYPE,@FEE,@SMS_CONTENT,@LINK_ID,@OUT_GATEWAY_ID,@WAPURL,@MSGSUM,@MSGSUB)

	

	ELSE if(@SUB_MOBILE_NO='130' OR @SUB_MOBILE_NO='131' OR @SUB_MOBILE_NO='132' OR @SUB_MOBILE_NO='155' OR @SUB_MOBILE_NO='156' OR @SUB_MOBILE_NO='185' OR @SUB_MOBILE_NO='186')

		insert into SMS_MT_CU_WAIT(GUID,DOWN_TIME,LONG_SERV_NO,SERV_CODE,MOBILE_NO,MOBILE_NO_TYPE,FEE_TYPE,FEE,SMS_CONTENT,LINK_ID,OUT_GATEWAY_ID,WAPURL,MSGSUM,MSGSUB) 

		values(@GUID,@DOWN_TIME,@LONG_SERV_NO,@SERV_CODE,@MOBILE_NO,2,@FEE_TYPE,@FEE,@SMS_CONTENT,@LINK_ID,@OUT_GATEWAY_ID,@WAPURL,@MSGSUM,@MSGSUB)

	ELSE

		insert into SMS_MT_CM_WAIT(GUID,DOWN_TIME,LONG_SERV_NO,SERV_CODE,MOBILE_NO,MOBILE_NO_TYPE,FEE_TYPE,FEE,SMS_CONTENT,LINK_ID,OUT_GATEWAY_ID,WAPURL,MSGSUM,MSGSUB) 

		values(@GUID,@DOWN_TIME,@LONG_SERV_NO,@SERV_CODE,@MOBILE_NO,1,@FEE_TYPE,@FEE,@SMS_CONTENT,@LINK_ID,@OUT_GATEWAY_ID,@WAPURL,@MSGSUM,@MSGSUB)

	

END;

GO

/****** Object:  Trigger [MOWAIT_InsertTrigger]    Script Date: 03/28/2011 10:41:37 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TRIGGER [dbo].[MOWAIT_InsertTrigger] 

    ON [dbo].[SMS_MO_WAIT] 

    AFTER INSERT 

AS 

BEGIN 

	declare @GUID varchar(50)

	declare @MSGID varchar(50)

	declare @UP_TIME Datetime

	declare @LONG_SERV_NO varchar(50)

	declare @SERV_CODE varchar(50)

	declare @MOBILE_NO varchar(50)

	declare @MOBILE_NO_TYPE char(1)

	declare @SMS_CONTENT varchar(160)

	declare @LINK_ID varchar(50)

	declare @OUT_GATEWAY_ID varchar(20)

	

	select @GUID=GUID,@MSGID=MSGID,@UP_TIME=UP_TIME,@LONG_SERV_NO=LONG_SERV_NO,

	@SERV_CODE=SERV_CODE,@MOBILE_NO=MOBILE_NO,@MOBILE_NO_TYPE=MOBILE_NO_TYPE,

	@SMS_CONTENT=SMS_CONTENT,@LINK_ID=LINK_ID,@OUT_GATEWAY_ID=OUT_GATEWAY_ID from inserted

	



	insert into SMS_MO(GUID,MSGID,UP_TIME,LONG_SERV_NO,SERV_CODE,MOBILE_NO,MOBILE_NO_TYPE,SMS_CONTENT,LINK_ID,OUT_GATEWAY_ID) 

	values(@GUID,@MSGID,@UP_TIME,@LONG_SERV_NO,@SERV_CODE,@MOBILE_NO,@MOBILE_NO_TYPE,@SMS_CONTENT,@LINK_ID,@OUT_GATEWAY_ID)



END;

GO

/****** Object:  Default [DF_SMS_REPORT_WAIT_REPORT_SUCCESS]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_REPORT_WAIT] ADD  CONSTRAINT [DF_SMS_REPORT_WAIT_REPORT_SUCCESS]  DEFAULT ((0)) FOR [REPORT_SUCCESS]

GO

/****** Object:  Default [DF_SMS_MT_TEL_WAIT_MOBILE_NO_TYPE]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_TEL_WAIT] ADD  CONSTRAINT [DF_SMS_MT_TEL_WAIT_MOBILE_NO_TYPE]  DEFAULT ((1)) FOR [MOBILE_NO_TYPE]

GO

/****** Object:  Default [DF_SMS_MT_TEL_WAIT_LINK_ID]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_TEL_WAIT] ADD  CONSTRAINT [DF_SMS_MT_TEL_WAIT_LINK_ID]  DEFAULT ('') FOR [LINK_ID]

GO

/****** Object:  Default [DF_SMS_MT_TEL_WAIT_OUT_GATEWAY_ID]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_TEL_WAIT] ADD  CONSTRAINT [DF_SMS_MT_TEL_WAIT_OUT_GATEWAY_ID]  DEFAULT ('') FOR [OUT_GATEWAY_ID]

GO

/****** Object:  Default [DF_SMS_MT_TEL_WAIT_WAPURL]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_TEL_WAIT] ADD  CONSTRAINT [DF_SMS_MT_TEL_WAIT_WAPURL]  DEFAULT ('') FOR [WAPURL]

GO

/****** Object:  Default [DF_SMS_MT_TEL_WAIT_MSGSUM]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_TEL_WAIT] ADD  CONSTRAINT [DF_SMS_MT_TEL_WAIT_MSGSUM]  DEFAULT ((1)) FOR [MSGSUM]

GO

/****** Object:  Default [DF_SMS_MT_TEL_WAIT_MSGSUB]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_TEL_WAIT] ADD  CONSTRAINT [DF_SMS_MT_TEL_WAIT_MSGSUB]  DEFAULT ((1)) FOR [MSGSUB]

GO

/****** Object:  Default [DF_SMS_MT_CU_WAIT_MOBILE_NO_TYPE]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CU_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CU_WAIT_MOBILE_NO_TYPE]  DEFAULT ((1)) FOR [MOBILE_NO_TYPE]

GO

/****** Object:  Default [DF_SMS_MT_CU_WAIT_LINK_ID]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CU_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CU_WAIT_LINK_ID]  DEFAULT ('') FOR [LINK_ID]

GO

/****** Object:  Default [DF_SMS_MT_CU_WAIT_OUT_GATEWAY_ID]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CU_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CU_WAIT_OUT_GATEWAY_ID]  DEFAULT ('') FOR [OUT_GATEWAY_ID]

GO

/****** Object:  Default [DF_SMS_MT_CU_WAIT_WAPURL]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CU_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CU_WAIT_WAPURL]  DEFAULT ('') FOR [WAPURL]

GO

/****** Object:  Default [DF_SMS_MT_CU_WAIT_MSGSUM]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CU_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CU_WAIT_MSGSUM]  DEFAULT ((1)) FOR [MSGSUM]

GO

/****** Object:  Default [DF_SMS_MT_CU_WAIT_MSGSUB]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CU_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CU_WAIT_MSGSUB]  DEFAULT ((1)) FOR [MSGSUB]

GO

/****** Object:  Default [DF_SMS_MT_CM_WAIT_MOBILE_NO_TYPE]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CM_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CM_WAIT_MOBILE_NO_TYPE]  DEFAULT ((1)) FOR [MOBILE_NO_TYPE]

GO

/****** Object:  Default [DF_SMS_MT_CM_WAIT_LINK_ID]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CM_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CM_WAIT_LINK_ID]  DEFAULT ('') FOR [LINK_ID]

GO

/****** Object:  Default [DF_SMS_MT_CM_WAIT_OUT_GATEWAY_ID]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CM_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CM_WAIT_OUT_GATEWAY_ID]  DEFAULT ('') FOR [OUT_GATEWAY_ID]

GO

/****** Object:  Default [DF_SMS_MT_CM_WAIT_WAPURL]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CM_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CM_WAIT_WAPURL]  DEFAULT ('') FOR [WAPURL]

GO

/****** Object:  Default [DF_SMS_MT_CM_WAIT_MSGSUM]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CM_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CM_WAIT_MSGSUM]  DEFAULT ((1)) FOR [MSGSUM]

GO

/****** Object:  Default [DF_SMS_MT_CM_WAIT_MSGSUB]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT_CM_WAIT] ADD  CONSTRAINT [DF_SMS_MT_CM_WAIT_MSGSUB]  DEFAULT ((1)) FOR [MSGSUB]

GO

/****** Object:  Default [DF_SMS_MT_SERV_CODE]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT] ADD  CONSTRAINT [DF_SMS_MT_SERV_CODE]  DEFAULT ('HELP') FOR [SERV_CODE]

GO

/****** Object:  Default [DF_SMS_MT_FEE_TYPE]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT] ADD  CONSTRAINT [DF_SMS_MT_FEE_TYPE]  DEFAULT ((1)) FOR [FEE_TYPE]

GO

/****** Object:  Default [DF_SMS_MT_FEE]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT] ADD  CONSTRAINT [DF_SMS_MT_FEE]  DEFAULT ((0)) FOR [FEE]

GO

/****** Object:  Default [DF_SMS_MT_STATUS]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT] ADD  CONSTRAINT [DF_SMS_MT_STATUS]  DEFAULT ((1)) FOR [STATUS]

GO

/****** Object:  Default [DF_SMS_MT_REPORT]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT] ADD  CONSTRAINT [DF_SMS_MT_REPORT]  DEFAULT ((0)) FOR [REPORT]

GO

/****** Object:  Default [DF_SMS_MT_REPORT_SUCCESS]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT] ADD  CONSTRAINT [DF_SMS_MT_REPORT_SUCCESS]  DEFAULT ((0)) FOR [REPORT_SUCCESS]

GO

/****** Object:  Default [DF_SMS_MT_SUBMIT_RESEND]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT] ADD  CONSTRAINT [DF_SMS_MT_SUBMIT_RESEND]  DEFAULT ((0)) FOR [SUBMIT_RESEND]

GO

/****** Object:  Default [DF_SMS_MT_WAPURL]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT] ADD  CONSTRAINT [DF_SMS_MT_WAPURL]  DEFAULT ('') FOR [WAPURL]

GO

/****** Object:  Default [DF_SMS_MT_ISLONGMSG]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT] ADD  CONSTRAINT [DF_SMS_MT_ISLONGMSG]  DEFAULT ((1)) FOR [MSGSUM]

GO

/****** Object:  Default [DF_SMS_MT_LONGMSGSEQ]    Script Date: 03/28/2011 10:41:37 ******/

ALTER TABLE [dbo].[SMS_MT] ADD  CONSTRAINT [DF_SMS_MT_LONGMSGSEQ]  DEFAULT ((1)) FOR [MSGSUB]

GO



/****** Object:  Table [dbo].[SMS_SEND]    Script Date: 07/08/2014 15:13:38 ******/

SET ANSI_NULLS ON

GO



SET QUOTED_IDENTIFIER ON

GO



SET ANSI_PADDING ON

GO



CREATE TABLE [dbo].[SMS_SEND](

	[batchid] [bigint] IDENTITY(1,1) NOT NULL,

	[smscontent] [varchar](1000) NULL,

	[sendtime] [datetime] NULL,

	[submittime] [date] NULL,

	[subnumber] [varchar](100) NULL,

	[status] [int] NULL,

	[SER_CODE] [int] NULL,

PRIMARY KEY CLUSTERED 

(

	[batchid] ASC

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

) ON [PRIMARY]



GO



SET ANSI_PADDING OFF

GO



ALTER TABLE [dbo].[SMS_SEND] ADD  DEFAULT (getdate()) FOR [sendtime]

GO



ALTER TABLE [dbo].[SMS_SEND] ADD  DEFAULT (getdate()) FOR [submittime]

GO



ALTER TABLE [dbo].[SMS_SEND] ADD  DEFAULT ((0)) FOR [status]

GO



/****** Object:  Table [dbo].[SMS_SEND_NO]    Script Date: 07/08/2014 15:14:02 ******/

SET ANSI_NULLS ON

GO



SET QUOTED_IDENTIFIER ON

GO



SET ANSI_PADDING ON

GO



CREATE TABLE [dbo].[SMS_SEND_NO](

	[id] [bigint] IDENTITY(1,1) NOT NULL,

	[batchid] [bigint] NULL,

	[mobileNo] [varchar](30) NULL,

PRIMARY KEY CLUSTERED 

(

	[id] ASC

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

) ON [PRIMARY]



GO



SET ANSI_PADDING OFF

GO