| Author |
Message |
DavidAtABC
Joined: 22 Aug 2006 Posts: 10
|
Posted: Fri May 04, 2007 3:49 pm Post subject: Describing stored procedure parameters |
|
|
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. |
|
| Back to top |
|
 |
david connell
Joined: 21 Nov 2005 Posts: 205
|
Posted: Tue May 08, 2007 12:53 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
drpsg
Joined: 03 Oct 2007 Posts: 6
|
|
| Back to top |
|
 |
David Atkinson
Joined: 05 Dec 2005 Posts: 1079
|
Posted: Thu Oct 18, 2007 10:59 am Post subject: |
|
|
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:
| Code: |
| 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 |
|
| Back to top |
|
 |
david connell
Joined: 21 Nov 2005 Posts: 205
|
Posted: Thu Oct 18, 2007 12:28 pm Post subject: |
|
|
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.
| Quote: |
[ @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 |
|
| Back to top |
|
 |
drpsg
Joined: 03 Oct 2007 Posts: 6
|
Posted: Thu Oct 18, 2007 1:20 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
|