Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2003
    Posts
    54

    Unanswered: formatted outputs

    Hi,
    Is there a way to get stored procedure texts out in a formatted way
    like defncopy in Sybase????? The way they print it out really
    sucks............

    Regards
    dba_sybase

  2. #2
    Join Date
    Sep 2003
    Location
    KY
    Posts
    146

    Why don't you use EM

    You can Use Enterprise manager to script them in formatted way .. unless you really not able to use Em .. or try using


    exec sp_helptext 'sp_name'

  3. #3
    Join Date
    Apr 2003
    Posts
    54
    Thanks AAshu. I already knew that but it seems that the third pary application created the SP as a single line. So I couldnot find a way to formatt them other than formatting them by hand.

    Thanks

    Jaideep

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Try this trick for a select statement (not updates or deletes!):

    Copy your line to the clipboard.
    Open select a table (any table) in your database in Enterprise Manager, right click, and select show all rows (or show data, or whatever).
    When the window opens up and displays the data, look for an icon near the top left that will display the SQL code applied (likely just a select from statement),
    Replace the SQL Statement with what you have on the clipboard and requery by clicking the red "!" icon.
    EM should reformat your code before displaying the results. If it doesn't, try adding a dummy table to the display and then removing it.

    Sorry if this isn't step-by-step clear, but I'm going from memory.

    Personally, I don't like the way EM formats statements, so I usually do some touch-up afterward, but its better than one long line of code.

    blindman

  5. #5
    Join Date
    Apr 2003
    Posts
    54
    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
  •