Error on Pages Export

Michael Legacy asked on September 6, 2019 17:22

Getting the following error on the Pages portion of doing an export. Can anyone tell me why this might be happening? Really frustrating.

Had to shorten the query as it was like 1000 lines line.

The important part is the exception at the bottom.

"Operand type clash: uniqueidentifier is incompatible with int"

ERROR:  Error exporting objects.
Message: 
[DataConnection.HandleError]: 

Query: 
SELECT *
FROM (
(
SELECT [AboutID], [IsCollage], [Main_Image], [CollageImage1], [CollageImage2], [CollageImage3], [Main_Text], [buttonMain_Text], [buttonMain_URL], [SecondaryText], [HeroImage], NULL AS [ArticleID], NULL AS [MainContent], NULL AS [ArticleDate], NULL AS [ItemCategory], NULL AS [FeaturedImage], NULL AS [TextExcerpt], NULL AS [ExternalLink_Bool], NULL AS [ExternalLink], NULL AS [CareersID], NULL AS [Title], NULL AS [buttonSecond_Text], NULL AS [buttonSecond_URL], NULL AS [ButtonsOnRight], NULL AS [MainButtonLinkExternal], NULL AS [SecondButtonLinkExternal], NULL AS [ConditionID], NULL AS [RelatedServices], NULL AS [ElsevierID], NULL AS [ConditionTier], NULL AS [UseElsevierContent], NULL AS [RelatedServicesImage], NULL AS [RelatedConditionsImage], NULL AS [RelatedConditions], NULL AS [RelatedServicesTitle], NULL AS [RelatedConditionsTitle], NULL AS [FeaturedInstitute], NULL AS [AccessiblePageBool], NULL AS [EventID], NULL AS [EventStart], NULL AS [EventEnd], NULL AS [Location], NULL AS [MainImage], NULL AS [Address], NULL AS [EventCategory], NULL AS [FileID], NULL AS [FileDescription], NULL AS [FileName], NULL AS [FileAttachment], NULL AS [FapID], NULL AS [For_doctorsID], NULL AS [GivingID], NULL AS [HomepageID], NULL AS [Tab1_Details], NULL AS [Tab1_Title], NULL AS [Tab1_Image1], NULL AS [Tab1_Image2], NULL AS [Tab1_Image3], NULL AS [Tab2_Image1], NULL AS [Tab2_Image2], NULL AS [Tab2_Image3], NULL AS [Tab3_Image1], NULL AS [Tab3_Image2], NULL AS [Tab3_Image3], NULL AS [Tab4_Image1], NULL AS [Tab4_Image2], NULL AS [Tab4_Image3], NULL AS [Tab5_Image1], NULL AS [Tab5_Image2], NULL AS [Tab5_Image3], NULL AS [Hero_Image], NULL AS [Tab2_Title], NULL AS [Tab2_Details], NULL AS [Tab3_Title], NULL AS [Tab3_Details], NULL AS [Tab4_Details], NULL AS [Tab4_Title], NULL AS [Tab5_Title], NULL AS [Tab5_Details], NULL AS [Tab1_ClickText], NULL AS [Tab2_ClickText], NULL AS [Tab3_ClickText], NULL AS [Tab4_ClickText], NULL AS [Tab5_ClickText], NULL AS [Tab1_ClickURL], NULL AS [Tab2_ClickURL], NULL AS [Tab3_ClickURL], NULL AS [Tab4_ClickURL], NULL AS [Tab5_ClickURL], NULL AS [InstituteID], NULL AS [FeaturedText], NULL AS [RelatedPages], NULL AS [FeaturedStory], NULL AS [MainResearchText], NULL AS [FeaturedService], NULL AS [HeaderImage], NULL AS [HeroVideoTitle], NULL AS [HeroFullVideoUrl], NULL AS [HeroVideoBackground], NULL AS [LocationsID], NULL AS [MainTitle], NULL AS [NewsID], NULL AS [ServiceID], NULL AS [ServiceTier], NULL AS [TreatedConditions], NULL AS [MainBodyContent], NULL AS [Standard_pageID], NULL AS [Standard_page_builderID], NULL AS [PageCategory], NULL AS [NewsCategory_Bool], NULL AS [FeaturedItem], NULL AS [PageLayout], [NodeID], [NodeAliasPath], [NodeName], [NodeAlias], [NodeClassID], [NodeParentID], [NodeLevel], [NodeACLID], [NodeSiteID], [NodeGUID], [NodeOrder], [IsSecuredNode], [NodeCacheMinutes], [NodeSKUID], [NodeDocType], [NodeHeadTags], [NodeBodyElementAttributes], [NodeInheritPageLevels], [RequiresSSL], [NodeLinkedNodeID], [NodeOwner], [NodeCustomData], [NodeGroupID], [NodeLinkedNodeSiteID], [NodeTemplateID], [NodeTemplateForAllCultures], [NodeInheritPageTemplate], [NodeAllowCacheInFileSystem], [NodeHasChildren], [NodeHasLinks], [NodeOriginalNodeID], [NodeIsContentOnly], [NodeIsACLOwner], [NodeBodyScripts], [DocumentID], [DocumentName], [DocumentNamePath], [DocumentModifiedWhen], [DocumentModifiedByUserID], [DocumentForeignKeyValue], [DocumentCreatedByUserID], [DocumentCreatedWhen], [DocumentCheckedOutByUserID], [DocumentCheckedOutWhen], [DocumentCheckedOutVersionHistoryID], [DocumentPublishedVersionHistoryID], [DocumentWorkflowStepID], [DocumentPublishFrom], [DocumentPublishTo], [DocumentUrlPath], [DocumentCulture], [DocumentNodeID], [DocumentPageTitle], [DocumentPageKeyWords], [DocumentPageDescription], [DocumentShowInSiteMap], [DocumentMenuItemHideInNavigation], [DocumentMenuCaption], [DocumentMenuStyle], [DocumentMenuItemImage], [DocumentMenuItemLeftImage], [DocumentMenuItemRightImage], [DocumentPageTemplateID], [DocumentMenuJavascript], [DocumentMenuRedirectUrl], [DocumentUseNamePathForUrlPath], [DocumentStylesheetID], [DocumentContent], [DocumentMenuClass], [DocumentMenuStyleHighlighted], [DocumentMenuClassHighlighted], [DocumentMenuItemImageHighlighted], [DocumentMenuItemLeftImageHighlighted], [DocumentMenuItemRightImageHighlighted], [DocumentMenuItemInactive], [DocumentCustomData], [DocumentExtensions], [DocumentTags], [DocumentTagGroupID], [DocumentWildcardRule], [DocumentWebParts], [DocumentRatingValue], [DocumentRatings], [DocumentPriority], [DocumentType], [DocumentLastPublished], [DocumentUseCustomExtensions], [DocumentGroupWebParts], [DocumentCheckedOutAutomatically], [DocumentTrackConversionName], [DocumentConversionValue], [DocumentSearchExcluded], [DocumentLastVersionNumber], [DocumentIsArchived], [DocumentHash], [DocumentLogVisitActivity], [DocumentGUID], [DocumentWorkflowCycleGUID], [DocumentSitemapSettings], [DocumentIsWaitingForTranslation], [DocumentSKUName], [DocumentSKUDescription], [DocumentSKUShortDescription], [DocumentWorkflowActionStatus], [DocumentMenuRedirectToFirstChild], [DocumentCanBePublished], [DocumentInheritsStylesheet], [DocumentPageBuilderWidgets], [DocumentPageTemplateConfiguration], [DocumentABTestConfiguration], [ClassName], [ClassDisplayName], ROW_NUMBER() OVER (ORDER BY DocumentName) AS [CMS_SRN], 0 AS [CMS_SN], 'cms.document.carle.about' AS [CMS_T]
FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) INNER JOIN carle_about AS C WITH (NOLOCK) ON [V].[DocumentForeignKeyValue] = [C].[AboutID] AND V.ClassName = N'carle.about' LEFT OUTER JOIN COM_SKU AS S WITH (NOLOCK) ON [V].[NodeSKUID] = [S].[SKUID]
WHERE [NodeSiteID] = @NodeSiteID
)

....more query...

) AS SubData
ORDER BY CMS_SN, NodeLevel ASC, NodeID

Caused exception: 
Operand type clash: uniqueidentifier is incompatible with int


Exception type: System.Exception
Stack trace: 
at CMS.DataEngine.AbstractDataConnection.HandleError(String queryText, Exception ex)
at CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)
at CMS.DataEngine.GeneralConnection.RunQuery(QueryParameters query)
at CMS.DataEngine.GeneralConnection.RunQueryWithRetry(QueryParameters query, Int32 retryCount)
at CMS.DataEngine.GeneralConnection.ExecuteQuery(QueryParameters query, Int32& totalRecords)
at CMS.DataEngine.DataQueryBase`1.GetDataFromDBInternal()
at CMS.DataEngine.DataQueryBase`1.GetDataFromDB()
at CMS.DataEngine.DataQueryBase`1.GetData()
at CMS.DataEngine.DataQueryBase`1.get_Result()
at CMS.DataEngine.DataQueryBase`1.GetResults(IDataQuery query, Int32& totalRecords)
at CMS.DataEngine.DataQueryBase`1.GetDataFromDB()
at CMS.DocumentEngine.DocumentQueryProperties.GetDataInternal(IDocumentQuery query, Func`1 baseGetDataMethod, Action`1 setTotalRecords)
at CMS.DataEngine.DataQueryBase`1.GetData()
at CMS.DataEngine.DataQueryBase`1.get_Result()
at CMS.DataEngine.MultiObjectQueryBase`3.EnsureTypedResult()
at CMS.DocumentEngine.Compatibility.NodesDataProvider.GetDataSet()
at CMS.DocumentEngine.DocumentExport.GetExportData_Before(Object sender, ExportGetDataEventArgs e)
at CMS.Base.AbstractHandler.CallEventHandler[TArgs](EventHandler`1 h, TArgs e)
at CMS.Base.AbstractHandler.Raise[TArgs](String partName, List`1 list, TArgs e, Boolean important)
at CMS.Base.AdvancedHandler`2.RaiseBefore(TArgs e)
at CMS.Base.AdvancedHandler`2.RaiseBefore(TArgs e)
at CMS.Base.AdvancedHandler`2.StartEvent(TArgs e, Boolean allowEvent)
at CMS.CMSImportExport.ExportProvider.GetExportData(SiteExportSettings settings, WhereCondition where, String objectType, Boolean childData, Boolean selectionOnly, TranslationHelper th)
at CMS.CMSImportExport.ExportProvider.ExportObjects(SiteExportSettings settings, String objectType, Boolean siteObjects, Boolean childData, Boolean selectionOnly, TranslationHelper th, GeneralizedInfo infoObj, ProcessObjectEnum processType)
at CMS.CMSImportExport.ExportProvider.GetExportData(SiteExportSettings settings, String objectType, Boolean siteObjects, Boolean childData, Boolean selectionOnly, TranslationHelper th)
at CMS.DocumentEngine.DocumentExport.ExportDocumentsData(SiteExportSettings settings, TranslationHelper th)
at CMS.DocumentEngine.DocumentExport.ExportObjects_Before(Object sender, ExportEventArgs e)
at CMS.Base.AbstractHandler.CallEventHandler[TArgs](EventHandler`1 h, TArgs e)
at CMS.Base.AbstractHandler.Raise[TArgs](String partName, List`1 list, TArgs e, Boolean important)
at CMS.Base.AdvancedHandler`2.RaiseBefore(TArgs e)
at CMS.Base.AdvancedHandler`2.RaiseBefore(TArgs e)
at CMS.Base.AdvancedHandler`2.StartEvent(TArgs e, Boolean allowEvent)
at CMS.CMSImportExport.ExportProvider.ExportObjectType(SiteExportSettings settings, TranslationHelper th, String objectType, Boolean siteObjects)
at CMS.CMSImportExport.ExportProvider.ExportObjectsData(SiteExportSettings settings)

Message: Operand type clash: uniqueidentifier is incompatible with int

Exception type: System.Data.SqlClient.SqlException
Stack trace: 
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
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.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)

at CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)

Recent Answers


Nikhila Reddy Pocha answered on September 8, 2019 19:52

I think you have built a procedure based on all tables that contain a same named column for example [NodeGUID] might contains in COM_SKU. I think you need to use alias while selecting the column in your sub query.

For example:

then your query look like as below

 SELECT *
    FROM (
    (
    SELECT V.[AboutID], V.[IsCollage], V.[Main_Image]))

Kindly re-form your current query and use alias for selecting column, let me know after this if you facing any issue.

3 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on September 9, 2019 10:21

Although the error is bit different as it is for different data type, maybe the cause is the same as described in this article. Could you please make sure that the page type fields have either unique names or if not, are using the same data type?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.