Windows utility.
Shows T-SQL and Ado.Net type information for a Sql Server table columns.
Basic one table only T-SQL and Ado.Net code generator.
Using this software
Selecting a table
Click on [ Table Selection ] tab.
Select a server, then a database, then a table. Click on [ ... ] buttons to read servers, databases, and tables lists, then select an item in the corresponding list.
Selecting columns
Click on [ Table Schema ] tab.
Displays a grid for the selected table. Shows for every column:
  • Name
  • T-SQL type
  • Size / precision
  • NULL value authorization
  • .NET Sql Server specific type
  • SqlDataReader accessor for .NET Sql Server specific type
  • SqlDbType enum value to use with SqlParameter
  • CLR type
  • SqlDataReader accessor for CLR type
  • DbType enum type to use with Parameter
A column contains checkboxes. They select columns used for code generation. Clicking on this column header reverses selection.
Right-click on the grid to copy a cell value.
Generating T-SQL code
Click on [ T-SQL Code ] tab.
A list allows selecting the T-SQL code to generate.
Can generate:
  • An INSERT query
  • An UPDATE query
  • A parameters list for a stored procedure
  • A parameters list with types for a stored procedure
  • A columns names list
The generated code can be copied to the clipboard.
Generating client code
Click on [ Client Code ] tab.
Generated .NET client code lines are built from some user entered text, and from values contained in the table schema tab grid.
Generated code can be copied to the clipboard.
This software would needs some more functionalities to be added: for instance, conditional code generating for the columns having a size/precision value (for output parameters), whether a column allows NULL value, automatic variables naming, or code generation definition saving to a file.
Required user privileges
Obviously, you need to run this utility from a user account which has rights to connect to the server, to the database, and to read the database schema.
Licence, Setup, and Downloading
Go to SqlServerCodeEditionHelper download page.