类似于下面这段,if object_id('dbo.aaaa') is not null
Begin
    drop table dbo.aaaa
Endcreate table aaaa这是判断有没有表aaaa,如果有则删除,再新添加

解决方案 »

  1.   

    go
    if object_id('dbo.aaaa') is not null
    drop table dbo.aaaa
    go
    create proc name........
      

  2.   


    go前面那句应该改为drop proc name
      

  3.   

    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语句生成功能啊,这人家不给出了吗
      

  4.   

      if OBJECT_ID('InserSale_DocOder') is not null  
      
      drop proc InserSale_DocOder