Added a simple bit of code to create dynamics from an SQL query.