Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Enterprise
Expertise: Intermediate
Dec 19, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Be Careful How You Name SQL Server Stored Procedures

When creating stored procedures in a database other then the Master database, avoid using the 'sp_' prefix. System stored procedures are the only ones that should use the 'sp_' prefix. The issue is not that naming a procedure in this manner causes errors executing the procedure, but rather it slows down execution. When a procedure is named 'sp_', SQL server first looks in the Master database to resolve where the procedure is located. If it is not in the Master database, execution time is wasted attempting to look it up. SQL Server then looks up the stored procedure name as if the object owner is 'dbo'. If the procedure is in the current working database, then it is executed.
Andrew Holliday
Thanks for your registration, follow us on our social networks to keep up-to-date