Try our conversational search powered by Generative AI!

Problem upgrading Commerce 1 R2 SP1 to R2 SP2


I'm trying to update an existing EpiServer Commerce site from version R2 SP1 to R2 SP2, but each time I run the update I'm getting the following error:

An unhandled error has occured:
Incorrect syntax near 'merge'.
When executing

At C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\Install\Modules\EPiServer Com
merce\ShareLib.ps1:93 char:26
+         Execute-EPiSqlSvrScript <<<<  -SqlServerName $csBuilder.DataSource -Databas
eName $csBuilder.InitialCatalog -ScriptPath $filePath -AvoidDbTransaction:$avoi
dTransaction -LoginName $csBuilder.UserID -LoginPassword $csBuilder.Password


At C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\Install\Modules\EPiServer Commerce\ShareLib.ps1:93 char:26
+         Execute-EPiSqlSvrScript <<<<  -SqlServerName $csBuilder.DataSource -DatabaseName $csBuilder.InitialCatalog -ScriptPath $filePath -AvoidDbTransaction:$avoidTransaction -LoginName $csBuilder.UserID -LoginPassword $csBuilder.Password
System.Data.SqlClient.SqlException: Incorrect syntax near 'merge'.
   at EPiServer.Install.SqlServer.Installers.SqlServerItemInstaller.HandleSqlException(SqlCommand cmd, SqlException ex)
   at EPiServer.Install.SqlServer.Installers.SqlScriptInstaller.ExecuteSqlScript(String filePath, IDictionary parameters, IDictionary stateSaver)
   at EPiServer.Install.SqlServer.Installers.SqlScriptInstaller.InstallInternal(IDictionary stateSaver)
   at EPiServer.Install.SqlServer.Installers.SqlScriptInstaller.Install(IDictionary stateSaver)
   at EPiServer.Install.InstallationManager.Install(Installer installer)
   at EPiServer.Install.SqlServer.SqlServerInstallationManager.ExecuteDatabaseScript(String sqlServerName, Nullable`1 sqlServerPort, String databaseName, String loginName, String loginPassword, String scriptFilePath, Boolean avoidDbTransaction, Boolean isEPiServerScript, IDictionary parameters)
   at EPiServer.Install.SqlServer.Cmdlets.ExecuteSqlScriptCmdlet.ProcessRecord()
   at System.Management.Automation.Cmdlet.DoProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()

Does somebody knows how to solve this problem?

Apr 13, 2012 13:29

Just change your compability level on your database to SQL Server 2008 (100) and you'll be fine!

Edited, Apr 20, 2012 9:36

Thanks André! It solved my problem.

May 01, 2012 10:52
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.