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)
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)
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)