In our software projects, we use a lot of in-line SQL as opposed to creating stored procedures. We also create data structure classes that essentially mirror the columns in a table. To save time, and because I'm always looking for the quick way to do things, I wrote this little program that generates SQL statements. Basically it creates the INSERT and UPDATE statements for a selected table. This output can then be cut and pasted into your code, saving typing time and eliminates misspelling of columns names. It will also generate custom code for each column, based on a simple token replace. For example, this line string [varname]; will create an output such as: string customerName; The token [varname] is replaced with the column name in the table. One bug (or feature) that I haven't gotten around to fixing is that when generating an INSERT, it will include the identity column. So you will need to manually remove that from the output before pasting into your code. |