if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetCheckDataInfo]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[GetCheckDataInfo]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetCheckDataInfoCount]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[GetCheckDataInfoCount]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_datatrans_ADD]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_datatrans_ADD]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UpdateDatacheckInfo]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UpdateDatacheckInfo]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[datacheck]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[datacheck]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[datatrans]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[datatrans]
GO
CREATE TABLE [dbo].[datacheck] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[domain_name] [varchar] (50) NOT NULL ,
[ftp_user] [varchar] (50) NOT NULL ,
[ftp_password] [varchar] (20) NOT NULL ,
[site_ip] [varchar] (60) NOT NULL ,
[site_ip_true] [varchar] (60) NULL ,
[db_password] [varchar] (20) NULL ,
[db_user] [varchar] (20) NULL ,
[db_ip] [varchar] (60) NULL ,
[db_name] [varchar] (50) NULL ,
[state_record] [varchar] (20) NULL ,
[update_ip] [int] NULL ,
[IsCheck] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[datatrans] (
[service_ip] [varchar] (60) NOT NULL ,
[site_name] [varchar] (100) NULL ,
[site_domain] [varchar] (200) NULL ,
[site_type] [tinyint] NOT NULL ,
[site_catalog] [varchar] (500) NULL ,
[site_catalog_date] [datetime] NULL ,
[site_version] [varchar] (100) NULL ,
[db_ip] [varchar] (60) NULL ,
[db_database] [varchar] (60) NULL ,
[db_user] [varchar] (60) NULL ,
[db_password] [varchar] (20) NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[datacheck] WITH NOCHECK ADD
CONSTRAINT [PK_datacheck] PRIMARY KEY CLUSTERED
(
[id]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[datacheck] ADD
CONSTRAINT [DF_datacheck_IsCheck] DEFAULT (0) FOR [IsCheck]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[GetCheckDataInfo]
@PageSize int
AS
BEGIN
SET NOCOUNT ON;
declare @sql varchar(500)
set @sql = 'select top '+ cast(@PageSize as varchar(10)) + ' [id],[domain_name],[site_ip],[ftp_user],[ftp_password],[db_ip],[db_user],[db_password],[db_name] from datacheck where IsCheck = 0'
exec(@sql)
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[GetCheckDataInfoCount]
AS
BEGIN
SET NOCOUNT ON;
select count([id]) from datacheck where [IsCheck] = 0
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
------------------------------------
--用途:增加一条记录
--项目名称:CodematicDemo
--说明:
--时间:2008-4-16 16:48:59
------------------------------------
CREATE PROCEDURE [dbo].[UP_datatrans_ADD]
@service_ip varchar(60),
@site_name varchar(100),
@site_domain varchar(200),
@site_type tinyint,
@site_catalog varchar(100),
@site_catalog_date datetime,
@site_version varchar(100),
@db_ip varchar(60),
@db_database varchar(60),
@db_user varchar(60),
@db_password varchar(20)
AS
INSERT INTO datatrans(
[service_ip],[site_name],[site_domain],[site_type],[site_catalog],[site_catalog_date],[site_version],[db_ip],[db_database],[db_user],[db_password]
)VALUES(
@service_ip,@site_name,@site_domain,@site_type,@site_catalog,@site_catalog_date,@site_version,@db_ip,@db_database,@db_user,@db_password
)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[UpdateDatacheckInfo]
@id int,
@TrueIp VarChar(60),--网站真实IP地址
@CheckMode varchar(10),--验证结果
@IpUpdateMode int--网站IP地址是否修改过
AS
BEGIN
SET NOCOUNT ON;
update datacheck set [site_ip_true] = @TrueIp,[state_record] = @CheckMode, [update_ip] = @IpUpdateMode,[IsCheck] = 1 where [id] = @id
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO