Error with Content Query Web Part in MOSS 2007 SP2
I'm getting:"There was an error in retrieving data to display in this webpart." This has been working fine for a year or two, and is just not acting up. We have it set to pull a certain content type all sites and subsites under the site collection. We are seeing this in the event log everytime we try to re-configure the web part and click OK or apply. A runtime exception was detected. Details follow. Message: All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists. Techinal Details: System.Data.SqlClient.SqlException: All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists. 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.ExecuteReader(CommandBehavior behavior) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior) at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean& bSucceed) at Microsoft.SharePoint.Library.SPRequestInternalClass.CrossListQuery(String bstrUrl, String bstrXmlWebs, String bstrXmlLists, String bstrXmlQuery, ISP2DSafeArrayWriter pCallback, Object& pvarColumns) at Microsoft.SharePoint.Library.SPRequest.CrossListQuery(String bstrUrl, String bstrXmlWebs, String bstrXmlLists, String bstrXmlQuery, ISP2DSafeArrayWriter pCallback, Object& pvarColumns) at Microsoft.SharePoint.SPWeb.GetSiteData(SPSiteDataQuery query) at Microsoft.SharePoint.Publishing.CrossListQueryCache.GetSiteData(CachedArea cachedArea, SPWeb web, SPSiteDataQuery query) Any ideas?
January 20th, 2011 9:32am

Have you deleted any column from content type on which your CEWP template is using for rendering?w: http://www.worldofsharepoint.com | t: @sharesandip
Free Windows Admin Tool Kit Click here and download it now
January 20th, 2011 10:28am

No, even when I choose no filters on the query, it gives me the above error. Thanks for the response
January 20th, 2011 10:52am

Hi Sean, Have you modified any lists using this content type? When we query all lists in a site using CQWP, it will combine the data of column created by and modified by for all lists. If a list had been modified that was being returned in the cross-list query so that the modified by and created by fields no longer matched in regards to the data within them and how this data is stored in SQL, this error will occur. So please capture SQL Profiler Trace while reproducing the failure and use this to determine which site/web/list and column is the offending entry causing the cross-list query failure. Best regards. Emir
Free Windows Admin Tool Kit Click here and download it now
January 27th, 2011 4:58am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics