Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: Search errors when you use Catalog Manager or the Catalog Search API to perform a search in Commerce Server 2009 R2


View products that this article applies to.

Symptoms

When you use Microsoft Commerce Server 2009 R2 Catalog Manager or the Catalog Search API in order to perform a search against a virtual catalog in Microsoft Commerce Server 2009 R2, one of the following issues may occur:

Issue 1

When you perform a search by using Commerce Server Catalog Manager or the Catalog Search API, and you use the list price as a search filter, the following message may be logged in the event log of the server:
An exception occurred in the 'CatalogWebService' Web service. Exception details follow:

Microsoft.CommerceServer.Catalog.CatalogDatabaseException: Search failed. ---> System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'AS'.

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
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.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at Microsoft.CommerceServer.Catalog.Internal.SqlHelper.ExecuteDataset(SqlConnection connection, CommandType commandType, String commandText, CatalogDataSetType catalogDataSetType, SqlParameter[] commandParameters, String outParameterName, Object& outParameterValue)
at Microsoft.CommerceServer.Catalog.Internal.SqlHelper.ExecuteDataset(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters, CatalogDataSetType catalogDataSetType, String outParameterName, Object& outParameterValue)
at Microsoft.CommerceServer.Catalog.Internal.SqlHelper.ExecuteDataset(String connectionString, String spName, Object[] parameterValues, CatalogDataSetType catalogDataSetType, String outParameterName, Object& outParameterValue)
at Microsoft.CommerceServer.Catalog.Internal.CommonHelpers.Search(CatalogExecutionContext executionContext, StringCollection catalogsToSearchCollection, String sqlClause, String ftsPhrase, String advancedFtsPhrase, String language, CatalogSearchOptions searchOptions, InventoryOptions inventoryOptions, JoinTableInformation joinTableInformation, String categoryClause, Boolean recursive, Int32& totalRecords, Boolean returnTotalRecords)

--- End of inner exception stack trace ---

at Microsoft.CommerceServer.Catalog.Internal.CommonHelpers.Search(CatalogExecutionContext executionContext, StringCollection catalogsToSearchCollection, String sqlClause, String ftsPhrase, String advancedFtsPhrase, String language, CatalogSearchOptions searchOptions, InventoryOptions inventoryOptions, JoinTableInformation joinTableInformation, String categoryClause, Boolean recursive, Int32& totalRecords, Boolean returnTotalRecords)
at Microsoft.CommerceServer.Catalog.Internal.CatalogContext.Search(CatalogExecutionContext catalogExecutionContext, StringCollection catalogsToSearch, String sqlClause, String ftsPhrase, String advancedftsPhrase, String language, CatalogSearchOptions searchOptions, InventoryOptions inventoryOptions, JoinTableInformation joinTableInformation, String categoryClause, Boolean recursive)
at Microsoft.CommerceServer.Catalog.Internal.CatalogSearch.Search(Int32& totalRecords, Boolean returnTotalRecords)
at Microsoft.CommerceServer.Catalog.Internal.CatalogServerContextBase.Search(CatalogSearchParameters catalogSearchParameters, CatalogSearchOptions searchOptions, InventoryOptions inventoryOptions, JoinTableInformation joinTableInformation)

Issue 2

When you use the Catalog Search API to perform a search in Commerce Server 2009 R2 and a large and complex SQL Where clause is used in the search, an exception occurs that resembles the following:
Microsoft.CommerceServer.Catalog.CatalogDatabaseException: Search failed. ---> System.Data.SqlClient.SqlException: String or binary data would be truncated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
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.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at Microsoft.CommerceServer.Catalog.Internal.SqlHelper.ExecuteDataset(SqlConnection connection, CommandType commandType, String commandText, CatalogDataSetType catalogDataSetType, SqlParameter[] commandParameters, String outParameterName, Object& outParameterValue)
at Microsoft.CommerceServer.Catalog.Internal.SqlHelper.ExecuteDataset(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters, CatalogDataSetType catalogDataSetType, String outParameterName, Object& outParameterValue)
at Microsoft.CommerceServer.Catalog.Internal.SqlHelper.ExecuteDataset(String connectionString, String spName, Object[] parameterValues, CatalogDataSetType catalogDataSetType, String outParameterName, Object& outParameterValue)

↑ Back to the top


Cause

These issues occur because of a logic error in the commerce server database.

↑ Back to the top


Resolution

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

To apply this hotfix, you must have Commerce Server 2009 R2 installed.

Restart requirement

You do not have to restart the computer after you apply this hotfix.

Installation Instructions

This hotfix package contains the following files:
  • CS2009R2RTM-KB2724950-x86.exe
  • KB2724950.sql
To prevent the occurrence of these issues in new catalog databases, run the CS2009R2RTM-KB2724950-x86.exe file to update the Catalogcreate.sql file for Commerce Server 2009 R2. Additionally, you must run the KB2724950.sql file against the existing catalog databases to resolve these issues.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

Commerce Server 2009 R2
File nameFile versionFile sizeDateTimePlatform
catalogcreate.sqlNot applicable1,164,20721-Jun-201219:36Not applicable

↑ Back to the top


More Information

If you experience a similar issue in Microsoft Commerce Server 2009, obtain the hotfix from Microsoft Knowledge Base (KB) 2280532. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

2280532 FIX: Virtual catalog search issues occur when you use the CatalogSearch class in Commerce Server 2009
For more information about the CatalogSearch class, go to the following MSDN website:For more information about the SqlWhereClause property, go to the following MSDN website:

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


Keywords: kbautohotfix, kbqfe, kbhotfixserver, kbfix, kbsurveynew, kbexpertiseadvanced, kb

↑ Back to the top

Article Info
Article ID : 2724950
Revision : 1
Created on : 1/7/2017
Published on : 7/16/2012
Exists online : False
Views : 339