判断有没有这个存储过程,如果有,则删除,然后添加
类似于下面这段,
if object_id('dbo.aaaa') is not null
Begin
drop table dbo.aaaa
End
create table aaaa
这是判断有没有表aaaa,如果有则删除,再新添加
------解决方案--------------------go
if object_id('dbo.aaaa') is not null
drop table dbo.aaaa
go
create proc name........
------解决方案--------------------
USE [GIS_old]
GO
/****** 对象: StoredProcedure [dbo].[DelCPInUserView] 脚本日期: 01/06/2012 16:38:23 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DelCPInUserView]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[DelCPInUserView]
楼主怎么不看SQL Server 2005自带的SQL语句生成功能啊,这人家不给出了吗
------解决方案-------------------- if OBJECT_ID('InserSale_DocOder') is not null
drop proc InserSale_DocOder