get output columns of a proc without executing it....

  • hi all,

    I can't remember how to do this and my google searches haven't been fruitful... but i know it's possible

    i forgot what it is but there is either a SET statement or a system proc that i can use to see the output columns a procedure will produce without actually executing that procedure... any idea?

  • You can use SET FMTONLY ON and then call the stored procedure to view the columns returned by the proc without executing it...remember to turn it OFF after you are done...

  • Try this:

    Select * From INFORMATION_SCHEMA.ROUTINE_COLUMNS

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • INFORMATION_SCHEMA.ROUTINE_COLUMNS only returns data for table valued functions and not for stored procedures right?

  • Yup, because a proc doesn't have a defined output. It's possible to have a procedure that returns various different resultsets (or none at all) depending on parameters passed.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • thanks!

Viewing 6 posts - 1 through 5 (of 5 total)

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