When creating an offline database for a POS unit using the Retail Channel Configuration Utility I was met with an error saying “An error occurred while creating the offline database”.
I could say positively that access rights and such were more or less correct since I could see the offline database popping up shortly when looking through the Management Studio. Googling a bit I found the error described as something with double DataAreaIds on some tables, but I could quickly rule that out.
So looking in the log-file (it is found in the folder where the Retail Channel Configuration Utility is installed) I found errors like this:
Error: 0 : EmbeddedInstall: CheckDatabase failed:System.Exception: CheckDatabase failed while creating database schema:System.Data.SqlClient.SqlException (0x80131904): Must declare the scalar variable “@nvc_INVENTLOCATIONDATAAREAID”. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
Errors like that could point in the direction of a collation mismatch. So I checked the collation of database I was referring to in the Retail Channel Configuration Utility. It was set to SQL_Latin1_General_CP1_CI_AS and the local SQL server I was trying to create the database on was set to Danish_Norwegian_CI_AS.
After reinstalling the local SQL server with the collation set to match the parent database I could create the offline database.
Oh, and while I remember it: You need the SQL Server Express with Advanced Features to make it work.