SQL - View Template

This article contains code for a SQL view template.

I work for 4 or 5 customers a day on support calls; I don't have the luxury of setting up SQL Server SSMS the way that I like it and coding blissfully.

A basic task for me would be creating a view; but I really don't like the templates that come with SQL. So, here's my template.

-- Drop stored procedure if it already exists
IF object_id(N'ddv_', 'V') IS NOT NULL
    DROP VIEW ddv_
GO
    
CREATE VIEW ddv_
    
AS
  
 
/* your code here */
 
GO
 
grant SELECT on ddv_ to public

 


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences