Refactored to use the SQL command class instead of just a string.