I always try to adopt the local standards. But where I’m setting one, here’s my Stored Procedure starting template …
-- NewProcTemplate.sql USE DemoDW GO /* ======================================================================== Author: Richard (RbS) Date: 19 July 2019 Usage: To list SalesPeople by Store. Example: Exec [DemoDW].[dbo].[SPU_DimSalespersonGetByStore] @Store = '1' Safe4Prod: NO! {by default} ============================================================================ */ ALTER proc SPU_DimSalespersonGetByStore -- SPU_{Object}{Action} @Store NVARCHAR(50) AS BEGIN; SET NOCOUNT ON; SELECT StoreName, SalespersonName FROM [DemoDW].[dbo].[DimSalesperson] WHERE StoreName = @Store; END GO
NOTE: I do not develop within this template. To stay open minded I always start development from a simple select star statement. Then when that’s all good, its pasted in here, parameterized, tested, and adjusted (thanks Doug).