• Bhuvnesh (1/28/2013)


    niha.736 (1/27/2013)


    How can I go with this SP's while creating or modifying.

    if exists (select 1 from sysobjects where name = 'getNotificateProduct')

    DROP PROCEDURE [dbo].[getNotificateProduct]

    GO

    Create PROCEDURE [dbo].[getNotificateProduct]

    (

    )

    begin

    ....

    ....

    end

    IS this what your are asking ?

    ALTER PROCEDURE [dbo].[getNotificateProduct]

    ...

    will replace the text of the existing procedure with the next text you specify.

    DROP will also drop all permissions and other things related to the proc (extended properties, etc.). That may not be a good idea in your environment.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.