Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored procedure naming conventions and standards 1

Status
Not open for further replies.

redlam

MIS
Jun 28, 2000
218
US
I have been tasked with setting naming conventions and standards for all stored procedures written by our company engineers. I am curious to find out if there is a 'common' standard for user sps but if anyone would like to share their own methods (common or uncommon) regarding this matter, any input would be greatly appreciated.
Thanks much!!!
 
I usually use the following:

Procedures that only retrieve data and do not change anything alls start with get

Procedures that update data start with upd

procedure that delete data start with del

I then just use a long descriptive name that describes what the procedure does. I do not start my stored procs with sp for two reasons A. it is usually obivous in code when you are refering to a stored procedure. B. It makes it easy to tell which are our store procs and which are the system stored procs. (I don't start my tables with tbl either, that one drives me nuts.)

 
OK Dear Redlam,
I use following naming conventions in my Stored Procedures ;

take an e.g.

stp_SAL_GetCustomers

stp = for Stored Procedure
SAL = Module Short name
GetCustomers = it is showing the purpose of the Stored Procedure.

few more exmaples ;
stp_SAL_DeleteCustomers
stp_SAL_UpdateCustomers
stp_SAL_InsertCustomers

I think , it will make categories of all of your SPs.

In coding , I declare parameters as follows ;

@P_CustomerID int ; @P_CustomerName varchar(100) so on for input paramerters.
@P_OUT_ErrCode int OUTPUT ; so on for output parameters.

I declare local variable as follows ;

@L_Counter int ;
@L_Price decimal ; so on.

Regards ,
essa2000



 
Acutally, I use Sybase's naming conventions. At one time, SQL Server and Sybase was the same product. Sybase has pushlished naming standards for database objects, whereas Microsoft has not.

I don't use Sybase products anymore, but do continue to use their naming conventions. If they still have a web site (and a company LOL), I would look into it...


Tom Davis
tdavis@sark.com
 
Sybase were still going strong last time I looked, although they did have a bit of a dip in fortunes! They have been trying to move more into the web database market. You'll find that Sybase is heavily used in banks as they earned a reputation for having a very reliable database....whereas SQL Server has had trouble convincing the big boys that it can handle very large databases (VLDBs).

Sorry chaps...a bit of an aside ;-) My Home -->
 
Sybase has published naming conventions for all of their database objects. I would look at these to give you an idea of how you would want to come up with your own conventions...

I simply use theirs because I am used to them and Microsoft never published standards for their database objects. Tom Davis
tdavis@sark.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top