For performance reasons I'm trying to use Entity Frameworks ExecuteSqlCommand to bulk update data. ctx.Database.ExecuteSqlCommand(updateQuery, new object[] {newValue} );
However I'm having trouble setting the Value-field of my table. It should multiply the existing value by a factor, but I'm receiving the following error:
Additional information: Error converting data type nvarchar to numeric.
newValue = "Value * 56,25";
String updateQuery = @"UPDATE dbo.BudgetLine_type1_unpivoted set Value = {0} where valueTypeID='Value2' AND Dim2 in ('712','718','722') AND Dim4 = '110' AND Period = 1"
int noRowsAffected = db.Database.ExecuteSqlCommand(updateQuery, new object[] {newValue} );
When setting newValue to "1" or simply "Value" (not changing anything) it works fine
How should I got about doing the multiplication? The value-field is of type decimal(28,6)