I updated my SQL Code Builder application this afternoon to fix a few bugs I ran across while I was building another application using it.  Here’s the list of bugs fixed:

* Fixed a bug in the Delete stored procedure where the parameters did not have a space between the "and" and the parameter name.
* Added code to handle the proper bounding of smalldatetime in SQL Server.  The dates will now be limited to 01-01-1900 and 12-31-2079 as they should be.  You can still pass DateTime.MinValue to the C# code to get it to pass NULL to the stored procedure but if you pass any value greater than DateTime.MinValue, it will be min and max bounded by acceptable values for the smalldatetime SQL type.
* Refactored the parameter code generation to make additional edits along the lines of the work done for smalldatetime easier to perform in the future.
* Fixed a bug where the update and save stored procedures were not getting the proper parameter lists generated.
* Changed the *_Save stored procedure code to use if EXISTS() logic instead of COUNT(*) logic to decide if the record needs updating or inserting.
* Fixed a bug in the *_Save stored procedure where the insert and update calls were reversed when using the new EXISTS logic.
* Added a setup project to the solution.

You can find the application by going to the SQL Server Stored Procedure and C# Object Code Builder page.