how to customize SMO script for ALTER or CREATE stored procedure

  • When I use SQL Server Management Studio I can define a script for creating a stored procedure

    Ex:

    USE [RM_BILLING]

    GO

    /****** Object: StoredProcedure [dbo].[Insert_Affiliate_Info] Script Date: 03/26/2010 18:03:31 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    -- ===============================================

    -- !!! Auto-Generated - Do Not Modify Directly !!!

    -- Created date...: 2010-03-25 @ 10.20.35

    -- Description....: Insert Affiliate_Info record

    -- !!! !!! Use tool to regenerate !!! !!!

    -- ===============================================

    ALTER PROCEDURE [dbo].[Insert_Affiliate_Info]

    (

    @affID Int,

    @affName VarChar(100)

    )

    AS

    BEGIN

    INSERT INTO Affiliate_Info

    (

    Aff_ID,

    Aff_Name

    )

    VALUES

    (

    @affID,

    @affName

    )

    END

    I want to use SMO objects to do this via a program.

    The only thing I can't figure out is how to get the date stamp comments into the script to create the stored procedure

    -- ===============================================

    -- !!! Auto-Generated - Do Not Modify Directly !!!

    -- Created date...: 2010-03-25 @ 10.20.35

    -- Description....: Insert Affiliate_Info record

    -- !!! !!! Use tool to regenerate !!! !!!

    -- ===============================================

    Any help would be greatly appreciated

    -Thanks in advance

    David

Viewing 0 posts

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