October 14, 2011 at 7:09 pm
I have a task of translating a stored procedure into plain English and documenting, which the customer should be able to easily understand. The stored procedure does the data cleansing.
Any idea or suggestion on how to proceed further? or any template would be of helpful.:-)
October 16, 2011 at 9:56 am
This shouldn't be difficult, comment the code by it's workable sections 😉 Clearly code that's "SELECT this, that, and the other thing from some TABLE" shouldn't be heavily documented as it's pretty much explained by what it's doing. You could add a noted before the SELECTs that say something like "Fetches data from the and perhaps mention the criteria in your WHERE clause".
We use a standard template at the beginning of our procedures to list who created it, recent changes, what it does, any specific notes, etc...
ALTER PROCEDURE [dbo].[__StoredProcedureTemplate]
@Param1 int,
@Param2 varchar(10) = 'Template'
AS
/*
----------------------------------------------------------------------------------------------------------------
Purpose:
Department:
Created For:
----------------------------------------------------------------------------------------------------------------
NOTES:
----------------------------------------------------------------------------------------------------------------
Created On:MM/DD/YYYY
Create By:Your Name
----------------------------------------------------------------------------------------------------------------
Modified On:
Modified By:
Changes:
1.
----------------------------------------------------------------------------------------------------------------
EXEC dbo.procname
*/
Best advice I can give is to keep it CONCISE yet simple, don't over-complicate the procedure by lengthy notes...
______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience
October 17, 2011 at 7:44 am
My guess is the client does not want to see stored procedure code (documented or not). They want to know the logic of the procedure. Since this is a "data cleansing" I suspect there is a mostly top down type approach. I find this type of thing works quite well as a flowchart in Visio.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
October 17, 2011 at 11:10 am
What you are asking for is called pseudocode. Here is one link, but if you google it you will find many examples and theory.
http://www.unf.edu/~broggio/cop2221/2221pseu.htm
Thanks,
Jared
Jared
CE - Microsoft
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply