Web Development, Quality Assurance Test Automation/Architecture & Performance Engineering | WI | 715.297.5484|help@dncllc.com

When the quickest route is not the best one.

//When the quickest route is not the best one.

When the quickest route is not the best one.

On a project to extend a certain piece of functionality from one site to another, I was asked a question by a third-party vendor why a stored procedure that they had taken from a sister site that was working just fine would not work on this site.  The procedure looked correct, but every time they try to run it in the development environment they received an error that for the column dateLastModified it could not be null.  Looking at the stored procedure there was indeed no mention of a value for that column, but on the first site it was working?

The vendor’s fix was to change the stored procedure to put in a default value for this column as “getDate()”.

This did fix the issue and did allow the procedure to work correctly, but why was that needed?  There had to be something deeper going on.  A review of the schema showed that on the first site where the unmodified procedure worked, there was this definition for it:

 

Ah ha!  Now I see it.  The column for the first site had a default value set.  The better route, and what we did ultimately, was to update the schema on the second site for this column to match the definition of the first one and then rolled the changes to the procedure back.  The operations completed normally.

This was a better solution as it kept the database schema more consistent between the two sites which makes it easier to update and test both.

 

Cheers!

By | 2018-05-21T17:52:52+00:00 May 21st, 2018|Blog|0 Comments

About the Author:

A veteran developer and IT professional who's been in the space since 1998. I've worked in many different size operations in many different types of industries in a wide array of roles. I'm very much the jack of all trades variety of person and always looking for the next pearl of knowledge to gobble up. When not solving the problems of the day, you may find me out for a hike, driving a tractor on the farm or attending a user group meeting.

Leave A Comment