Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    5

    Unanswered: Viewing stored produre code from query analyser

    Hi

    Can anyone tell me the way to view stored produre code from query analyser. With sp_help I can only view input paramters
    Cheers

  2. #2
    Join Date
    Feb 2003
    Location
    India
    Posts
    216
    Try this one

    declare @spBody as varchar(5000)
    set @spBody = (select text from syscomments where id=object_id('<your SP Name>'))
    print @spBody

  3. #3
    Join Date
    Mar 2004
    Posts
    5
    Thanks for your comment

    However I dont get any data when i run the query

    Lou

  4. #4
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Use SP_HELPTEXT to view code contents of a SP or trigger etc.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  5. #5
    Join Date
    Mar 2004
    Posts
    5
    Thanks

Posting Permissions

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