Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    1

    Unanswered: stored procedure?

    is there a easy way to print out the code in a dynamic stored procedure or something?

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245
    Quote Originally Posted by MountainUU
    is there a easy way to print out the code in a dynamic stored procedure or something?
    Do you mean retrieving the text of a stored procedure?

    Try this:
    Code:
    select text 
    from syscomments 
    where id in (select id from sysobjects where xtype = 'p')
    Note that it is always a BAD practice to query system objects (such as syscomments and sysobjects).

    Regards,

    hmscott
    Have you hugged your backup today?

  3. #3
    Join Date
    Mar 2005
    Location
    Netherlands
    Posts
    280
    I don't know if that's what he wants but the easiest way is:
    Code:
    sp_helptext <My_stp_name>
    Lex

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •