Red Gate forums :: View topic - Describing stored procedure parameters
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Doc 1
SQL Doc 1 forum

Describing stored procedure parameters

Search in SQL Doc 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
DavidAtABC



Joined: 22 Aug 2006
Posts: 10

PostPosted: Fri May 04, 2007 3:49 pm    Post subject: Describing stored procedure parameters Reply with quote

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
View user's profile Send private message
david connell



Joined: 21 Nov 2005
Posts: 207

PostPosted: Tue May 08, 2007 12:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
drpsg



Joined: 03 Oct 2007
Posts: 6

PostPosted: Thu Oct 18, 2007 10:35 am    Post subject: Feature Request Reply with quote

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/articles/Stored+Procedures/tsqldoc/678/

Can RedGate implement this?
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1124
Location: Twitter: @dtabase

PostPosted: Thu Oct 18, 2007 10:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
david connell



Joined: 21 Nov 2005
Posts: 207

PostPosted: Thu Oct 18, 2007 12:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
drpsg



Joined: 03 Oct 2007
Posts: 6

PostPosted: Thu Oct 18, 2007 1:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group