Start workperiod fails after export/import

I exported DB from SQL server 2016 to MS SQL server 2012 using MS export import tool. Starting Work period fails now with the following error log

[General Info]

Application: SambaPOS
Version: 4.1.82
Region: en
DB: SQ
Machine: ANIL-PC
User: anil
Date: 11/27/2017
Time: 6:25 PM

User Explanation:

anil said “”

[Exception Info 1]

Top-level Exception
Type: System.Data.Entity.Infrastructure.DbUpdateException
Message: An error occurred while updating the entries. See the inner exception for details.
Source: EntityFramework
Stack Trace: at System.Data.Entity.Internal.InternalContext.SaveChanges()
at System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
at System.Data.Entity.DbContext.SaveChanges()
at Samba.Infrastructure.Data.SqlData.EFWorkspace.CommitChanges()
at Samba.Persistance.Implementations.WorkPeriodDao.StartWorkPeriod(String description, IWorkspace workspace)
at Samba.Presentation.Services.Implementations.WorkPeriodModule.WorkPeriodService.StartWorkPeriod(String description)

Inner Exception 1
Type: System.Data.UpdateException
Message: An error occurred while updating the entries. See the inner exception for details.
Source: System.Data.Entity
Stack Trace: at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
at System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache)
at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
at System.Data.Entity.Internal.InternalContext.SaveChanges()

Inner Exception 2
Type: System.Data.SqlClient.SqlException
Message: Cannot insert the value NULL into column ‘Id’, table ‘SambaPOS4V12.dbo.WorkPeriods’; column does not allow nulls. INSERT fails.
The statement has been terminated.
Source: .Net SqlClient Data Provider
Stack Trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& 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.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary2 identifierValues, List`1 generatedValues)
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)


[Assembly Info]

PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
System.Configuration, Version=4.0.0.0
Samba.Services, Version=1.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
Samba.Presentation.Common, Version=1.0.0.0
Samba.Domain, Version=1.0.0.0
PresentationCore, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.6.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
System.Core, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
FastButton, Version=1.0.0.0


[System Info]

Operating System
-Microsoft Windows 7 Professional
–CodeSet = 1252
–CSDVersion = Service Pack 1
–CurrentTimeZone = 330
–FreePhysicalMemory = 2178312
–OSArchitecture = 64-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 1
–ServicePackMinorVersion = 0
–Version = 6.1.7601

Machine
-ANIL-PC
–Manufacturer = Dell Inc.
–Model = Latitude E4310
–TotalPhysicalMemory = 4150108160
–UserName = anil-PC\anil


######################### E N D #########################
Please help.
regards
Anil Sarin

Not sure if you can downgrade like that… Is there a reason you want to downgrade SQL version?

1 Like

I replaced my aging main working system machine, a Win 7 running SQL 2012 with a Windows 10 machine and used (carelessly) SQL server 2016 for SambaPOS. My standby system is a Windows 7. Now I am left with a non working standby system as the backup from Main system can’t be restored on the standby’s SQL 2012. SQL 2016 is not compatible with Win 7. So the standby machine can’t move to 2016. Only options left are downgrading Main machine SQL to 2012 or replacing the standby with a Windows 10 machine.

I have successfully downgraded from 2016 to 2014 before.

1 Like

Tried, but the script does not run with insufficient memory error on a 4GB machine.
thanks and regards.

If you want to PM me a copy of your database I can try it for you.

You can get windows 10 for free still. I would update.

2 Likes

Its a 22MB zip. I can share it on google drive. Please send me your email id.
thanks

That shows how to get windows 10 for free up until dec31. My guess is they wont kill it after dec31 though

2 Likes