Are you referring to Access VBA Procedures and SQL SErver Stored Procedures?
Note that you posted in the Forum for Microsoft Access, a database application included as part of Microsoft Office suite.
If your question is related to SQL Server Stored Procedure, you should re-word your question with more details, e.g. the T-SQL of the current Stored Procedure you want to optimize and re-post in one of the forums for SQL Server such as:
Getting Started with SQL Server or
Transact-SQL
Van Dinh