Click here to Skip to main content
15,886,067 members
Articles / Web Development / ASP.NET

Template-Based Code Generation with SmartCode

Rate me:
Please Sign up or sign in to vote.
4.82/5 (35 votes)
25 Dec 20067 min read 100.8K   3.5K   121  
SmartCode is a template based code generator.This tutorial describes the process of building a templates to SmartCode
SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
-- Stored Procedure usp_Employees_Insert
-- Purpose: Insert one row in table Employees
-- Parameters:

	USE Northwind

	-- First delete the stored procedure if it already exists.
	If (EXISTS (SELECT * FROM dbo.sysobjects
			WHERE (Name = 'usp_Employees_Insert') AND (Type = 'P')))
		DROP PROCEDURE usp_Employees_Insert
	GO

-- This stored procedure was created 
-- on Saturday, December 02, 2006 at 9:57:54 PM.
-- Template: Insert One Row
-- Purpose: Insert one row in table Employees

 CREATE PROCEDURE usp_Employees_Insert
    @LastName nvarchar(20) ,
    @FirstName nvarchar(10) ,
    @Title nvarchar(30) ,
    @TitleOfCourtesy nvarchar(25) ,
    @BirthDate datetime ,
    @HireDate datetime ,
    @Address nvarchar(60) ,
    @City nvarchar(15) ,
    @Region nvarchar(15) ,
    @PostalCode nvarchar(10) ,
    @Country nvarchar(15) ,
    @HomePhone nvarchar(24) ,
    @Extension nvarchar(4) ,
    @Photo image ,
    @Notes ntext ,
    @ReportsTo int ,
    @PhotoPath nvarchar(255) 
     AS 
         INSERT INTO [Employees]
     (
           [LastName] , 
           [FirstName] , 
           [Title] , 
           [TitleOfCourtesy] , 
           [BirthDate] , 
           [HireDate] , 
           [Address] , 
           [City] , 
           [Region] , 
           [PostalCode] , 
           [Country] , 
           [HomePhone] , 
           [Extension] , 
           [Photo] , 
           [Notes] , 
           [ReportsTo] , 
           [PhotoPath] 
	)
     VALUES 
     (
         @LastName ,
         @FirstName ,
         @Title ,
         @TitleOfCourtesy ,
         @BirthDate ,
         @HireDate ,
         @Address ,
         @City ,
         @Region ,
         @PostalCode ,
         @Country ,
         @HomePhone ,
         @Extension ,
         @Photo ,
         @Notes ,
         @ReportsTo ,
         @PhotoPath
	)

     GO 

-- End Procedure

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
Danilo is the creator of SmartRules, a Business Rules Engine. He is an industry consultant working primarily with companies interested in implementing dynamic rules programming concepts to add flexibility to their architectures on web, CE, and desktop platforms. He operates his own website, Kontac, where you will find more information.

To contact Danilo, email him at danilo.mendez@gmail.com.

Comments and Discussions