When using SQLServer with sqlAccessType="StoredProcedure" default values that are set in the database are not applied because NULL is being set to the parameter in the generated stored procedures and it is not excluded from the INSERT when null.
Because excluding columns with "database default values" that are passed in NULL to the SP would make the SP to complicated. Are you able to update the script that generates the SP to extract the database default value and supply it in the SP argument list.
Code:
ALTER PROCEDURE [dbo].[proc_LoanApplicationInsert]
(
@AppUserGUID uniqueidentifier,
@LoanApplication_Id int = NULL output,
@Market_Id int,
@Community_Id int = 0 --- Defaulted to 0
@InsertDate = GETDATE() --- Default to Current Date: Put the default value here instead of NULL
...
}Well just a thought. I have a workaround now by just using DynamicSQL. This is nice because it only passed columns that are dirty.