ECQWP SQL Exception

Sep 25, 2008 at 7:11 AM
Hi,

i have created a discussion board on my site and subsites.
I am using this webpart to fetch data from all these discussion boards,depending upon certain filters.
I have created a new Site Column (Preview) as Single line of text and Required.I added this column within all discussion boards.It worked perfectly for pulling data from all sites and subsites untill now,but when i created a new site with previous site template,ECQWP stopped working.
I crosschecked Discussion boards settings in new site,but all of them are same as in above sites.But ECQWP does not pull data from anywhere and crashes with following exception:
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.SqlInternalConnection.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)


When i remove Preview sitecolumn,ECQWP starts pulling data from sites and subsites except new site.

Any pointers in solving this problem.

I crosschecked with OOB CQWP with 'Preview' field in CommonViewFields as well and same error is coming there as well.

Amit