title: Parameter value is out of range
body: <p>It seems EF is padding zeros to the value that I'm trying to save and then throwing an exception.  Here is my code:  Why is the total hours field with a value of 10.17 out of range of a decimal(6,5) value type and why is it padding this value with zeros?  Saving this value directly using SQL Server Management Studio doesn't seem to be a problem, so it seems more like a problem with EF.</p>
  
  <p>This is from a database first .edmx file.  I've tried setting the scale and precision and setting to none.  Neither have worked</p>
  
  <pre><code> var rVal = new Data.FactPayrollHour()
                  {
                      BereavementHours = 0.0M,
                      CostCenter = "MyCostCenter",
                      Department = "MyDepartment",
                      EmergencyHours = 0.0M,
                      HomeGroupCode = "MyHomeGroup",
                      PayrollEmployeeId = employees.FirstOrDefault().Id,
                      PayType = "MyPayType",
                      PunchDateKey = dateDims.FirstOrDefault().ID,
                      Schedule = "",
                      ServiceHours = 0.0M,
                      Shift = "",
                      ShortTermHours = 0.0M,
                      TimePolicy = "",
                      TotalHours = 10.17M,
                      UnpaidHours = 0.0M,
                      VacationHours = 0.0M
                  };
                  db.FactPayrollHours.Add(rVal);
                  db.SaveChanges();
  </code></pre>
  
  <p>The exception message is: <code>Parameter value '10.17000' is out of range.</code></p>
  
  <p>Stack Trace:</p>
  
  <pre><code>   at System.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, _SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource`1 completion, Int32 startRpc, Int32 startParam)
     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task&amp; task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task&amp; task, Boolean&amp; usedCache, Boolean asyncWrite, Boolean inRetry)
     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
     at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
     at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
     at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.&lt;Reader&gt;b__c(DbCommand t, DbCommandInterceptionContext`1 c)
     at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
     at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
     at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
     at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
     at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues)
     at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
  </code></pre>