/******************************************************************
* 表名:Ph_AdInfo
* 时间:2008-8-30 20:14:06
******************************************************************/
------------------------------------
--用途:得到最大ID
--项目名称:
--说明:
--时间:2008-8-30 20:14:06
------------------------------------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_Ph_AdInfo_GetMaxId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_Ph_AdInfo_GetMaxId]
GO
CREATE PROCEDURE UP_Ph_AdInfo_GetMaxId
AS
DECLARE @TempID int
SELECT @TempID = max([id])+1 FROM Ph_AdInfo
IF @TempID IS NULL
RETURN 1
ELSE
RETURN @TempID
GO
------------------------------------
--用途:是否已经存在
--项目名称:
--说明:
--时间:2008-8-30 20:14:06
------------------------------------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_Ph_AdInfo_Exists]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_Ph_AdInfo_Exists]
GO
CREATE PROCEDURE UP_Ph_AdInfo_Exists
@id int
AS
DECLARE @TempID int
SELECT @TempID = count(1) FROM Ph_AdInfo WHERE [id] = @id
IF @TempID = 0
RETURN 0
ELSE
RETURN 1
GO
------------------------------------
--用途:增加一条记录
--项目名称:
--说明:
--时间:2008-8-30 20:14:06
------------------------------------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_Ph_AdInfo_ADD]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_Ph_AdInfo_ADD]
GO
CREATE PROCEDURE UP_Ph_AdInfo_ADD
@id int ,
@PalecType int ,
@AdContent text ,
@AdType int ,
@Url varchar(200) ,
@Title varchar(100) ,
@CreateTime datetime
AS
INSERT INTO Ph_AdInfo(
[id],[PalecType],[AdContent],[AdType],[Url],[Title],[CreateTime]
)VALUES(
@id,@PalecType,@AdContent,@AdType,@Url,@Title,@CreateTime
)
GO
------------------------------------
--用途:修改一条记录
--项目名称:
--说明:
--时间:2008-8-30 20:14:06
------------------------------------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_Ph_AdInfo_Update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_Ph_AdInfo_Update]
GO
CREATE PROCEDURE UP_Ph_AdInfo_Update
@id int,
@PalecType int,
@AdContent text,
@AdType int,
@Url varchar(200),
@Title varchar(100),
@CreateTime datetime
AS
UPDATE Ph_AdInfo SET
[PalecType] = @PalecType,[AdContent] = @AdContent,[AdType] = @AdType,[Url] = @Url,[Title] = @Title,[CreateTime] = @CreateTime
WHERE [id] = @id
GO
------------------------------------
--用途:删除一条记录
--项目名称:
--说明:
--时间:2008-8-30 20:14:06
------------------------------------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_Ph_AdInfo_Delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_Ph_AdInfo_Delete]
GO
CREATE PROCEDURE UP_Ph_AdInfo_Delete
@id int
AS
DELETE Ph_AdInfo
WHERE [id] = @id
GO
------------------------------------
--用途:得到实体对象的详细信息
--项目名称:
--说明:
--时间:2008-8-30 20:14:06
------------------------------------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_Ph_AdInfo_GetModel]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_Ph_AdInfo_GetModel]
GO
CREATE PROCEDURE UP_Ph_AdInfo_GetModel
@id int
AS
SELECT * FROM Ph_AdInfo
WHERE [id] = @id
GO
------------------------------------
--用途:查询记录信息
--项目名称:
--说明:
--时间:2008-8-30 20:14:06
------------------------------------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_Ph_AdInfo_GetList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_Ph_AdInfo_GetList]
GO
CREATE PROCEDURE UP_Ph_AdInfo_GetList
AS
SELECT
[id],[PalecType],[AdContent],[AdType],[Url],[Title],[CreateTime]
FROM Ph_AdInfo
GO