This project is read-only.

Project Description
SQL Sprocket is an open source template-based code generating tool for SQL Server 2005, 2008 R2, and 2012. It requires no syntax to learn, but its powerful simplicity will have you generating stored procedures, objects, and TSQL code from your database schema in minutes.

How does SQLsprocket work?
Everything is a template, so you have full control over almost every aspect of SQL Sprocket. The output generation is based on three types of templates, and the list of tables found in your database:

  • Table List Statement – User Mode
  • Metadata Templates – Advanced Mode
  • Dictionary Templates – Advanced Mode
  • Output Templates – User Mode

Table List
You have full control over the way your database tables are listed in SQL Sprocket. Use the default or update the SQL that populates the list of database tables to your preference.

Metadata Templates
Metadata templates give you control over how the data is queried from the SQL Server database and the information provided to the Dictionary Templates. If Microsoft makes any changes to the SQL Server Information_Schema views in a later release just make a quick update to the Metadata Template and you are back to work.

Dictionary Templates
Most users will never need to touch the Dictionary or Metadata Templates, but the flexibilty to change how the output is generated using C# or TSQL is available If you need more output types or just want to change the default processing, Dictionary Templates make it possible to tailor the output generation to your needs.

Output Templates
Output Templates allow you to use the data collected from your database schema along with the <output> parameters to generate your database code the way you want it.

How easy is it to use?
There is no complex syntax to learn, and you can start generating output based on your SQL Server database in minutes.

  1. Start the tool and connect to your SQL 2005, 2008, or 2012 database.
  2. Create the Output templates for your specific development needs or use the TSQL templates provided.
  3. Select the tables and templates you want to use to generate code.
  4. Click Execute and generate your code.
  5. Copy the code to a script or compile it against your database.

That’s it! Your TSQL generation is done.

Last edited Jun 25, 2012 at 10:12 PM by mritacco, version 7