modify proc creates odd script

  • when i select modifiy proc i get the below: Is there an option that would force it to simply show as an alter proc and do away w/ all of this sp_executesql nonesence?

    /****** Object: StoredProcedure [dbo].[aaaaatest] Script Date: 12/18/2012 9:47:50 AM ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[aaaaatest]') AND type in (N'P', N'PC'))

    BEGIN

    EXEC dbo.sp_executesql @statement = N'ALTER PROCEDURE [dbo].[aaaaatest]

    AS

    SELECT ''this is a test'''

    END

  • you can turn off the sp_execute scripting, so it's a cleaner CREATE / ALTER PROCEDURE.... by changing a flag the flag "Include IF NOT EXISTS Clause" in the scripting options, and then youget the results you were looking for featuring ALTER;

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply