if ( LEN(arguments.userDefinedDSN) ) variables.dsn = arguments.userDefinedDSN; else variables.dsn = application.ptImport.appConfig.migration_DSN; var appConfig = application.ptImport.getAppConfig(); variables.contentContainer = ""; if ( arguments.siteType EQ "new" ) variables.contentContainer = appConfig.new_content_container; else if ( arguments.siteType EQ "old" ) variables.contentContainer = appConfig.old_content_container; SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '#variables.tableView#' CREATE VIEW #variables.tableView# AS SELECT ControlInstance.PageID, ControlInstance.ControlID, AvailableControls.Name, AvailableControls.ShortDesc, ControlInstance.ControlType, ControlInstance.ControlName, ControlInstance_TopLevel.ControlName AS parentControlName, ControlInstance.ParentControlID, ControlInstance.DateDeleted FROM AvailableControls INNER JOIN ControlInstance ON AvailableControls.ID = ControlInstance.ControlType LEFT OUTER JOIN ControlInstance_TopLevel ON ControlInstance.ParentControlID = ControlInstance_TopLevel.ControlID WHERE (ControlInstance.PageID <> ControlInstance.ControlID) SELECT * FROM #variables.tableView# ORDER BY ControlInstance.PageID SELECT * FROM #variables.tableView# WHERE PageID = OR PageID IN () AND parentControlID = ORDER BY PageID var containerQry = QueryNew("null"); var mainControlID = getTopControlID(variables.contentContainer); var pageTemplateQry = getSitePage(arguments.pageid); var pageInheritTemplateList = ListAppend(pageTemplateQry.InheritedTemplateList, arguments.pageid); SELECT * FROM DATA_SCHEDULE_ITEMS WHERE VersionState >= 2 AND controlid = AND PAGEID IN () ORDER BY PageID DESC, ItemPos ASC var tabularQry = QueryNew("null"); var mainControlID = getTopControlID(variables.contentContainer); var pageTemplateQry = getSitePage(arguments.pageid); var pageInheritTemplateList = ListAppend(pageTemplateQry.InheritedTemplateList, arguments.pageid); SELECT * FROM DATA_LAYOUTCELL WHERE VersionState >= 2 AND controlid = AND PAGEID IN () ORDER BY PageID DESC SELECT * FROM Data_LinkList_Items WHERE PageID = AND ControlID = AND VersionState >= 2 ORDER BY VersionState DESC SELECT * FROM Data_TextBlock WHERE PageID = AND ControlID = AND VersionState >= 2 ORDER BY VersionState DESC SELECT * FROM Data_Image WHERE PageID = AND ControlID = AND VersionState >= 2 ORDER BY VersionState DESC SELECT controlID FROM ControlInstance_TopLevel WHERE ControlName = SELECT * FROM SitePages WHERE ID = ORDER BY ControlID --->