Describing stored procedure parameters

DavidAtABCDavidAtABC Posts: 16
edited October 18, 2007 8:20AM in SQL Doc Previous Versions
Is there a way to attach a description to stored procedure parameters, to all a description of their function, for example - similar to table row descriptions?

And how is this displayed in SQL Doc?

Thanks,

David.

Comments

  • Hi David,
    If you are using SQL 2005 then the parameter should be listed just above the SQL Script. (Check out AdventureWorks SPs like [HumandResources].[uspUpdateEmployeeHireInfo] have all their params documented.)However I donot think that parameters are shown/displayed for SQL 2000 databases.
    Hope that helps
    David
  • I see that the description of a stored procedure parameter isn't documented.

    Here is a example what a free tool can do: http://www.sqlservercentral.com/article ... qldoc/678/

    Can RedGate implement this?
  • I'm looking at the output for AdventureWorks/Programmability/Stored Procedures/dbo.uspGetBillOfMaterials and SQL Doc has documented the parameters in their own table. As for all the objects, it uses the MS_Description extended property, for example:
    sp_addextendedproperty N'MS_Description', N'Input parameter for the stored procedure uspGetBillOfMaterials. Enter a valid ProductID from the Production.Product table.', 'SCHEMA', N'dbo', 'PROCEDURE', N'uspGetBillOfMaterials', 'PARAMETER', N'@StartProductID'
    

    Let me know if you're looking for different functionality/behaviour.

    Kind regards,

    David Atkinson
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
  • Hi there,
    I think that Microsoft had documented all these attributes in books on line.
    I have just looked in "SQL Server 2005 Books Online" under the topic sp_addextendedproperty.
    [ @level0name = ] { 'level0_object_name' }
    Is the name of the level 0 object type specified. level0_object_name is sysname with a default of NULL.

    [ @level1type = ] { 'level1_object_type' }
    Is the type of level 1 object. level1_object_type is varchar(128), with a default of NULL. Valid inputs are AGGREGATE, DEFAULT, FUNCTION, LOGICAL FILE NAME, PROCEDURE, QUEUE, RULE, SYNONYM, TABLE, TYPE, VIEW, XML SCHEMA COLLECTION, and NULL.

    [ @level1name = ] { 'level1_object_name' }
    Is the name of the level 1 object type specified. level1_object_name is sysname, with a default of NULL.

    [ @level2type = ] { 'level2_object_type' }
    Is the type of level 2 object. level2_object_type is varchar(128), with a default of NULL. Valid inputs are COLUMN, CONSTRAINT, EVENT NOTIFICATION, INDEX, PARAMETER, TRIGGER, and NULL.

    [ @level2name = ] { 'level2_object_name' }
    Is the name of the level 2 object type specified. level2_object_name is sysname, with a default of NULL.
    Hope that helps.
    Kind regards
    David Connell
  • okay,

    Maybe I have to clarify more:

    I have a self made stored procedure and I want to describe the parameters of that procedure. How can I get that description in SQL doc behind the parameters?

    Thnx
Sign In or Register to comment.