Category Archives: Software Design

Simple MySQL Stored Procedure

Here’s a simple stored procedure I find myself using for MySQL over and over again.  If you use a person’s email address as a database key, you may need to occasionally update their email address, and as such, you should update all references.  Here’s a simple stored procedure to accomplish this:
DELIMITER $$

DROP PROCEDURE IF EXISTS [...]

App.config Settings for a Project with no Output

Sometimes more than just connection strings need to be stored to a settings or configuration file of some kind. If you are building a mult-tier application and your project is a class library with no run-able code, you can’t just throw settings into an app.config file. Likewise, you wouldn’t want to put your tier-specific settings [...]

SQL Server Find Text in Any Field

In working with SQL server 2005, I came across this useful query which will loop through every table and every field in a database searching for specified text.  This can really come in handy when you’re debugging someone else’s un-documented database and you know the text, but you’re not sure where it is stored in [...]

MySQL Blob Insert Error

When using MySQL to store things such as files, it is best to use a blob field.  If you’re using a blob field, but having trouble with inserting some data into it (like a file), you might want to check the MySQL environment varibale max_allowed_packet.  The max_allowed_packet variable can be found in your configuration file [...]