Geeks With Blogs
Catherine Russell Architect, President of "Women In Information Technology" Group

TinySQL is small and handy SQL script which can quickly generate consistent code snippet that you can paste in your project. It basically operates by reading schema of provided table and applying template to each column of table in order to generate code snippet.

With TinySQL, you can create complete or specific portion of business class, business service, or data access layer. You can also generate repetitive code snippet like storing all DataReader columns into respective property of business object, or passing all object properties to SqlParameter in data access layer, or creating stored procedures for a table or creating simple update or insert statement in stored procedure etc.

TinySQL is definitely not a replacement of sophisticated code generation tools like CodeSmith, TierDeveloper, LLBLGen etc. Those tools are very advance and can generate code for whole project including user interface, business layer, data access layers and even store procedures. TinySQL can only generate basic code snippet that you can use in your existing code or project.

Implementation of TinySQL is very simple and straight forward. It reads schema definition of all columns of provided table and template; it then render code by rotating loop for each column. Variable you have to take care in TinySQL are:

@TableName: table name for which you want to generate code
@PrintTableName: how above table name should display in generated code. You may have table "tblCategories" but you want "Category" as class name.
@Template: Template for generated code

Open TinySQL in SQL Management Studio, provide table name and template, press F5 to execute TinySQL and you will have generated code in result pane. Now you just have to copy generated code from result pane and paste in your project.

To download the tool go to:

Posted on Tuesday, October 12, 2010 9:02 AM Tutorials , ASP.NET | Back to top

Comments on this post: TinySQL - small and handy SQL script which can quickly generate consistent code snippet.

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © CatherineRussell | Powered by: