创建存储过程之前判断是否存在

if   exists  ( select   *   from  dbo.sysobjects  where  id  =   object_id (N ' [dbo].[UP_forums_CodeScheduleType_Update] ' and   OBJECTPROPERTY (id, N ' IsProcedure ' =   1 )
drop   procedure   [ dbo ] . [ UP_forums_CodeScheduleType_Update ]
GO
-- ----------------------------------
--
用途:修改一条记录 
--
项目名称:CodematicDemo
--
说明:
--
时间:2008-9-12 16:30:44
--
----------------------------------
CREATE   PROCEDURE  UP_forums_CodeScheduleType_Update
@ScheduleTypeCode   int ,
@ScheduleDescription   varchar ( 30 )
 
AS  
    
UPDATE  forums_CodeScheduleType  SET  
    
[ ScheduleDescription ]   =   @ScheduleDescription
    
WHERE  ScheduleTypeCode = @ScheduleTypeCode  

GO

你可能感兴趣的:(存储过程)