attributes.ownerIdFrom = 3644; attributes.ownerIdTo = 26; attributes.ownerType = "MFR"; attributes.datasource = "fslibrary_rpc"; select t.name tableName, c.name ownerIdColumn, c2.name ownerTypeColumn from syscolumns c inner join sysobjects t on t.id = c.id inner join syscolumns c2 on c2.id = t.id and c2.name = 'ownerType' where c.name = 'ownerId' and t.name like 'tbl%' union select t.name tableName, c.name ownerIdColumn, c2.name ownerTypeColumn from syscolumns c inner join sysobjects t on t.id = c.id inner join syscolumns c2 on c2.id = t.id and c2.name = 'fsl_tablecode' where c.name = 'ownerId' and t.name like 'tbl%' union select t.name tableName, c.name ownerIdColumn, c2.name ownerTypeColumn from syscolumns c inner join sysobjects t on t.id = c.id inner join syscolumns c2 on c2.id = t.id and c2.name = 'fsltablecode' where c.name = 'ownerId' and t.name like 'tbl%' order by tableName
BAD Table Name: #htmleditformat( _tableName )#
select count(*) rowsInTable from #qmd_tables.tableName# where #ownerIdColumn# = #attributes.ownerIdFrom# and #ownerTypeColumn# = '#attributes.ownerType#'
#htmleditformat( tableName )# - #lsnumberformat( qmd_tablestats.rowsInTable )# Ignoring Deleting delete from #tableName# where #ownerIdColumn# = #attributes.ownerIdTo# and #ownerTypeColumn# = '#attributes.ownerType#' Moving update #tableName# set #ownerIdColumn# = #attributes.ownerIdTo# where #ownerIdColumn# = #attributes.ownerIdFrom# and #ownerTypeColumn# = '#attributes.ownerType#'
select distinct subjectDetailId skuId from tbl_SPL_OpportunitySubjectDetails where ownerId = #attributes.ownerIdTo# and ownerType = '#attributes.ownerType#' and subjectDetailType = 'SKU' select prodId from tbl_PRD_Skus where ownerId = #attributes.ownerIdFrom# and fsl_tablecode = '#attributes.ownerType#' and skuId in ( #listappend( valueList( qmd_skus.skuId ), 0 )# ) union select subjectId prodId from tbl_SPL_Opportunities where ownerId = #attributes.ownerIdTo# and ownerType = '#attributes.ownerType#' select distinct categoryId from tbl_PRD_Products where ownerId = #attributes.ownerIdFrom# and fsl_tablecode = '#attributes.ownerType#' update tbl_PRD_Categories set ownerId = #attributes.ownerIdTo# where ownerId = #attributes.ownerIdFrom# and fsl_tablecode = '#attributes.ownerType#' and categoryId in ( #listappend( valuelist( qmd_categories.categoryId ), 0 )# ) update tbl_PRD_Products set ownerId = #attributes.ownerIdTo# where ownerId = #attributes.ownerIdFrom# and fsl_tablecode = '#attributes.ownerType#' and prodId in ( #listappend( valuelist( qmd_products.prodId ), 0 )# ) update tbl_PRD_Skus set ownerId = #attributes.ownerIdTo# where ownerId = #attributes.ownerIdFrom# and fsl_tablecode = '#attributes.ownerType#' and skuId in ( #listappend( valuelist( qmd_skus.skuId ), 0 )# )