create procedure sys.sp_MSdrop_rlrecon
as
if object_id('sp_MSaddinitialpublication','P') is not NULL
drop procedure sys.sp_MSaddinitialpublication
if object_id('sp_MSaddinitialsubscription','P') is not NULL
drop procedure sys.sp_MSaddinitialsubscription
if object_id('sp_MSdropconstraints','P') is not NULL
drop procedure sys.sp_MSdropconstraints
if object_id('sp_MSexclause','P') is not NULL
drop procedure sys.sp_MSexclause
if object_id('sp_MSgetcolordinalfromcolname','P') is not NULL
drop procedure sys.sp_MSgetcolordinalfromcolname
if object_id('sp_MSinsertbeforeimageclause','P') is not NULL
drop procedure sys.sp_MSinsertbeforeimageclause
if object_id('sp_MSdropctsviews','P') is not NULL
drop procedure sys.sp_MSdropctsviews
if object_id('sp_MSmakectsview','P') is not NULL
drop procedure sys.sp_MSmakectsview
if object_id('sys.fn_MSgetrowguidvirtualtable', 'FN') is not NULL
drop function sys.fn_MSgetrowguidvirtualtable
if object_id('sys.fn_MSgetrowguidvirtualtable', 'TF') is not NULL
drop function sys.fn_MSgetrowguidvirtualtable
if object_id('sys.fn_MSgetrowguids', 'FN') is not NULL
drop function sys.fn_MSgetrowguids
if object_id('sys.fn_MSgetrowguids', 'TF') is not NULL
drop function sys.fn_MSgetrowguids
if object_id('sp_MSdeletemetadataactionrequest','P') is not NULL
drop procedure sys.sp_MSdeletemetadataactionrequest
if object_id('sp_MSmakeinsertproc','P') is not NULL
drop procedure sys.sp_MSmakeinsertproc
if object_id('sp_MSmakebatchinsertproc','P') is not NULL
drop procedure sys.sp_MSmakebatchinsertproc
if object_id('sp_MSmakeupdateproc','P') is not NULL
drop procedure sys.sp_MSmakeupdateproc
if object_id('sp_MSmakebatchupdateproc','P') is not NULL
drop procedure sys.sp_MSmakebatchupdateproc
if object_id('sp_MScreatedupkeyupdatequery','P') is not NULL
drop procedure sys.sp_MScreatedupkeyupdatequery
if object_id('sp_MSmakeselectproc','P') is not NULL
drop procedure sys.sp_MSmakeselectproc
if object_id('sp_MSmakemetadataselectproc','P') is not NULL
drop procedure sys.sp_MSmakemetadataselectproc
if object_id('sp_MSmakedeleteproc','P') is not NULL
drop procedure sys.sp_MSmakedeleteproc
if object_id('sp_MSreplcheck_permission','P') is not NULL
drop procedure sys.sp_MSreplcheck_permission
if object_id('sp_MSinsertschemachange','P') is not NULL
drop procedure sys.sp_MSinsertschemachange
if object_id('sp_MSaddinitialarticle','P') is not NULL
drop procedure sys.sp_MSaddinitialarticle
if object_id('sp_MSaddinitialschemaarticle','P') is not NULL
drop procedure sys.sp_MSaddinitialschemaarticle
if object_id('sp_MSinitdynamicsubscriber','P') is not NULL
drop procedure sys.sp_MSinitdynamicsubscriber
if object_id('sp_MSmakearticleprocs','P') is not NULL
drop procedure sys.sp_MSmakearticleprocs
if object_id('sp_MScreateandsetarticleprocs','P') is not NULL
drop procedure sys.sp_MScreateandsetarticleprocs
if object_id('sp_MSpostapplyscript_forsubscriberprocs','P') is not NULL
drop procedure sys.sp_MSpostapplyscript_forsubscriberprocs
if object_id('sp_MSscriptsubscriberprocs','P') is not NULL
drop procedure sys.sp_MSscriptsubscriberprocs
if object_id('sp_MSchecksnapshotstatus','P') is not NULL
drop procedure sys.sp_MSchecksnapshotstatus
if object_id('sp_MSupdatesysmergearticles','P') is not NULL
drop procedure sys.sp_MSupdatesysmergearticles
if object_id('sp_MSdroparticletombstones','P') is not NULL
drop procedure sys.sp_MSdroparticletombstones
if object_id('sp_MSproxiedmetadata','P') is not NULL
drop procedure sys.sp_MSproxiedmetadata
if object_id('sp_MSproxiedmetadatabatch','P') is not NULL
drop procedure sys.sp_MSproxiedmetadatabatch
if object_id('sp_MShelpmergearticles','P') is not NULL
drop procedure sys.sp_MShelpmergearticles
if object_id('sp_MShelpmergeselectarticles','P') is not NULL
drop procedure sys.sp_MShelpmergeselectarticles
if object_id('sp_MShelpmergearticles_nonpartgroups','P') is not NULL
drop procedure sys.sp_MShelpmergearticles_nonpartgroups
if object_id('sp_MShelpmergeidentity','P') is not NULL
drop procedure sys.sp_MShelpmergeidentity
if object_id('sp_MShelpmergeschemaarticles','P') is not NULL
drop procedure sys.sp_MShelpmergeschemaarticles
if object_id('sp_MScheckidentityrange','P') is not NULL
drop procedure sys.sp_MScheckidentityrange
if object_id('sp_MSfetchidentityrange','P') is not NULL
drop procedure sys.sp_MSfetchidentityrange
if object_id('sp_MScreateretry','P') is not NULL
drop procedure sys.sp_MScreateretry
if object_id('sp_MSdropretry','P') is not NULL
drop procedure sys.sp_MSdropretry
if object_id('sp_MSdroptemptable','P') is not NULL
drop procedure sys.sp_MSdroptemptable
if object_id('sp_MSenumretries','P') is not NULL
drop procedure sys.sp_MSenumretries
if object_id('sp_MSdeleteretry','P') is not NULL
drop procedure sys.sp_MSdeleteretry
if object_id('sp_MSgetonerow','P') is not NULL
drop procedure sys.sp_MSgetonerow
if object_id('sp_MSchangearticleresolver','P') is not NULL
drop procedure sys.sp_MSchangearticleresolver
if object_id('sp_MSgetlastrecgen','P') is not NULL
drop procedure sys.sp_MSgetlastrecgen
if object_id('sp_MSgetlastsentgen','P') is not NULL
drop procedure sys.sp_MSgetlastsentgen
if object_id('sp_MSgetlastsentrecgens','P') is not NULL
drop procedure sys.sp_MSgetlastsentrecgens
if object_id('sp_MSsetlastrecgen','P') is not NULL
drop procedure sys.sp_MSsetlastrecgen
if object_id('sp_MSbelongs','P') is not NULL
drop procedure sys.sp_MSbelongs
if object_id('sp_MSsetupbelongs','P') is not NULL
drop procedure sys.sp_MSsetupbelongs
if object_id('sp_MSgetsetupbelong_cost','P') is not NULL
drop procedure sys.sp_MSgetsetupbelong_cost
if object_id('sp_MSsetupworktables','P') is not NULL
drop procedure sys.sp_MSsetupworktables
if object_id('sp_MSsetupnotbelongs','P') is not NULL
drop procedure sys.sp_MSsetupnotbelongs
if object_id('sp_MSsetupbelongs_withoutviewproc','P') is not NULL
drop procedure sys.sp_MSsetupbelongs_withoutviewproc
if object_id('sp_MSexpandbelongs','P') is not NULL
drop procedure sys.sp_MSexpandbelongs
if object_id('sp_MSexpandnotbelongs','P') is not NULL
drop procedure sys.sp_MSexpandnotbelongs
if object_id('sp_MSenumpartialdeletes','P') is not NULL
drop procedure sys.sp_MSenumpartialdeletes
if object_id('sp_MSsetlastsentgen','P') is not NULL
drop procedure sys.sp_MSsetlastsentgen
if object_id('sp_MSdummyupdate','P') is not NULL
drop procedure sys.sp_MSdummyupdate
if object_id('sp_MSgetalternaterecgens','P') is not NULL
drop procedure sys.sp_MSgetalternaterecgens
if object_id('sp_MSupdaterecgen','P') is not NULL
drop procedure sys.sp_MSupdaterecgen
if object_id('sp_MSupdatereplicastate','P') is not NULL
drop procedure sys.sp_MSupdatereplicastate
if object_id('sp_MSgetreplicastate','P') is not NULL
drop procedure sys.sp_MSgetreplicastate
if object_id('sp_MSdummyupdate90','P') is not NULL
drop procedure sys.sp_MSdummyupdate90
if object_id('sp_MSrequestreenumeration','P') is not NULL
drop procedure sys.sp_MSrequestreenumeration
if object_id('sp_MSenum_metadataaction_requests','P') is not NULL
drop procedure sys.sp_MSenum_metadataaction_requests
if object_id('sp_MSsetgentozero', 'P') is not null
drop procedure sys.sp_MSsetgentozero
if object_id('sp_MSenumgenerations','P') is not NULL
drop procedure sys.sp_MSenumgenerations
if object_id('sp_MSenumgenerations90','P') is not NULL
drop procedure sys.sp_MSenumgenerations90
if object_id('sp_MScheckexistsgeneration','P') is not NULL
drop procedure sys.sp_MScheckexistsgeneration
if object_id('sp_MSenumreplicas','P') is not NULL
drop procedure sys.sp_MSenumreplicas
if object_id('sp_MSenumreplicas90','P') is not NULL
drop procedure sys.sp_MSenumreplicas90
if object_id('sp_MSenumdeletesmetadata','P') is not NULL
drop procedure sys.sp_MSenumdeletesmetadata
if object_id('sp_MSenumchanges','P') is not NULL
drop procedure sys.sp_MSenumchanges
if object_id('sp_MSenumchangesdirect','P') is not NULL
drop procedure sys.sp_MSenumchangesdirect
if object_id('sp_MSenumpartialchanges','P') is not NULL
drop procedure sys.sp_MSenumpartialchanges
if object_id('sp_MSenumpartialchangesdirect','P') is not NULL
drop procedure sys.sp_MSenumpartialchangesdirect
if object_id('sp_MSenumchanges_belongtopartition','P') is not NULL
drop procedure sys.sp_MSenumchanges_belongtopartition
if object_id('sp_MSenumchanges_notbelongtopartition','P') is not NULL
drop procedure sys.sp_MSenumchanges_notbelongtopartition
if object_id('sp_MSenumdeletes_forpartition','P') is not NULL
drop procedure sys.sp_MSenumdeletes_forpartition
if object_id('sp_MSgetrowmetadata','P') is not NULL
drop procedure sys.sp_MSgetrowmetadata
if object_id('sp_MSgetmetadatabatch','P') is not NULL
drop procedure sys.sp_MSgetmetadatabatch
if object_id('sp_MSgetmetadatabatch90','P') is not NULL
drop procedure sys.sp_MSgetmetadatabatch90
if object_id('sp_MSgetmetadatabatch90new','P') is not NULL
drop procedure sys.sp_MSgetmetadatabatch90new
if object_id('sp_MSsetrowmetadata','P') is not NULL
drop procedure sys.sp_MSsetrowmetadata
if object_id('sp_MSinsertgenhistory','P') is not NULL
drop procedure sys.sp_MSinsertgenhistory
if object_id('sp_MSupdategenhistory','P') is not NULL
drop procedure sys.sp_MSupdategenhistory
if object_id('sp_MSlocalizeinterruptedgenerations') is not null
drop procedure sys.sp_MSlocalizeinterruptedgenerations
if object_id('sys.fn_MapSchemaType', 'FN') is not null
drop function sys.fn_MapSchemaType
if object_id('sp_enumeratependingschemachanges','P') is not NULL
drop procedure sys.sp_enumeratependingschemachanges
if object_id('sp_markpendingschemachange','P') is not NULL
drop procedure sys.sp_markpendingschemachange
if object_id('sp_MSenumschemachange','P') is not NULL
drop procedure sys.sp_MSenumschemachange
if object_id('sp_MSenumschemachange_70','P') is not NULL
drop procedure sys.sp_MSenumschemachange_70
if object_id('sp_MSenumschemachange_80','P') is not NULL
drop procedure sys.sp_MSenumschemachange_80
if object_id('sp_MSenumschemachange_80sp3','P') is not NULL
drop procedure sys.sp_MSenumschemachange_80sp3
if object_id('sp_MSenumschemachange_90','P') is not NULL
drop procedure sys.sp_MSenumschemachange_90
if object_id('sp_MSenumschemachange_100','P') is not NULL
drop procedure sys.sp_MSenumschemachange_100
if object_id('sp_MSupdateschemachange','P') is not NULL
drop procedure sys.sp_MSupdateschemachange
if object_id('sp_MSadd_mergereplcommand','P') is not NULL
drop procedure sys.sp_MSadd_mergereplcommand
if object_id('sp_MSremove_mergereplcommand','P') is not NULL
drop procedure sys.sp_MSremove_mergereplcommand
if object_id(N'sys.sp_MSgetreplicainfo', 'P') is not null
drop procedure sys.sp_MSgetreplicainfo
if object_id(N'sys.sp_MSgetsupportabilitysettings', 'P') is not null
drop procedure sys.sp_MSgetsupportabilitysettings
if object_id(N'sys.sp_MSuploadsupportabilitydata', 'P') is not null
drop procedure sys.sp_MSuploadsupportabilitydata
if object_id(N'sys.sp_MSneedmergemetadataretentioncleanup', 'P') is not null
drop procedure sys.sp_MSneedmergemetadataretentioncleanup
if object_id(N'sys.sp_MScheck_subscription_partition', 'P') is not null
drop procedure sys.sp_MScheck_subscription_partition
if object_id('sp_MSsetreplicainfo','P') is not NULL
drop procedure sys.sp_MSsetreplicainfo
if object_id('sp_MSsetreplicastatus','P') is not NULL
drop procedure sys.sp_MSsetreplicastatus
if object_id('sp_MScreateglobalreplica','P') is not NULL
drop procedure sys.sp_MScreateglobalreplica
if object_id('sp_MSsetconflictscript','P') is not NULL
drop procedure sys.sp_MSsetconflictscript
if object_id('sp_MSsetconflicttable','P') is not NULL
drop procedure sys.sp_MSsetconflicttable
if object_id('sp_MSmakeconflictinsertproc','P') is not NULL
drop procedure sys.sp_MSmakeconflictinsertproc
if object_id('sp_MSmaketempinsertproc','P') is not NULL
drop procedure sys.sp_MSmaketempinsertproc
if object_id('sp_MSgetconflictinsertproc','P') is not NULL
drop procedure sys.sp_MSgetconflictinsertproc
if object_id('sp_MSinsertdeleteconflict','P') is not NULL
drop procedure sys.sp_MSinsertdeleteconflict
if object_id('sp_MScheckmetadatamatch','P') is not NULL
drop procedure sys.sp_MScheckmetadatamatch
if object_id('sp_MSdelrow','P') is not NULL
drop procedure sys.sp_MSdelrow
if object_id('sp_MSdelrowsbatch','P') is not NULL
drop procedure sys.sp_MSdelrowsbatch
if object_id('sp_MSdelrowsbatch_downloadonly','P') is not NULL
drop procedure sys.sp_MSdelrowsbatch_downloadonly
if object_id('sp_MSsetartprocs','P') is not NULL
drop procedure sys.sp_MSsetartprocs
if object_id('sp_MSmakesystableviews','P') is not NULL
drop procedure sys.sp_MSmakesystableviews
if object_id('sp_MSdropview_internal','P') is not NULL
drop procedure sys.sp_MSdropview_internal
if object_id('sp_MSdropsystableviews','P') is not NULL
drop procedure sys.sp_MSdropsystableviews
if object_id('sp_MSgetchangecount','P') is not NULL
drop procedure sys.sp_MSgetchangecount
if object_id('sp_MSuplineageversion','P') is not NULL
drop procedure sys.sp_MSuplineageversion
if object_id('sp_MSvalidatearticle','P') is not NULL
drop procedure sys.sp_MSvalidatearticle
if object_id('sp_MSgetviewcolumnlist','P') is not NULL
drop procedure sys.sp_MSgetviewcolumnlist
if object_id('sp_MSsubscriptionvalidated','P') is not NULL
drop procedure sys.sp_MSsubscriptionvalidated
if object_id('sp_MSdelsubrows','P') is not NULL
drop procedure sys.sp_MSdelsubrows
if object_id('sp_MSdelsubrowsbatch','P') is not NULL
drop procedure sys.sp_MSdelsubrowsbatch
if object_id('sp_MScontractsubsnb','P') is not NULL
drop procedure sys.sp_MScontractsubsnb
if object_id('sp_MSexpandsubsnb','P') is not NULL
drop procedure sys.sp_MSexpandsubsnb
if object_id('sp_MSmakeviewproc','P') is not NULL
drop procedure sys.sp_MSmakeviewproc
if object_id('sp_MScreatebeforetable','P') is not NULL
drop procedure sys.sp_MScreatebeforetable
if object_id('sp_MShelpcreatebeforetable','P') is not NULL
drop procedure sys.sp_MShelpcreatebeforetable
if object_id('sp_MShelpalterbeforetable','P') is not NULL
drop procedure sys.sp_MShelpalterbeforetable
if object_id('sp_MSgetbeforetableinsert','P') is not NULL
drop procedure sys.sp_MSgetbeforetableinsert
if object_id('sp_MSfixupbeforeimagetables','P') is not NULL
drop procedure sys.sp_MSfixupbeforeimagetables
if object_id('sp_MSinserterrorlineage','P') is not NULL
drop procedure sys.sp_MSinserterrorlineage
if object_id('sp_MSevalsubscriberinfo','P') is not NULL
drop procedure sys.sp_MSevalsubscriberinfo
if object_id('sp_MSsetsubscriberinfo','P') is not NULL
drop procedure sys.sp_MSsetsubscriberinfo
if object_id('sp_MSgetsubscriberinfo','P') is not NULL
drop procedure sys.sp_MSgetsubscriberinfo
if object_id('sp_MSinsertgenerationschemachanges','P') is not NULL
drop procedure sys.sp_MSinsertgenerationschemachanges
if object_id('sp_MSalreadyhavegeneration','P') is not NULL
drop procedure sys.sp_MSalreadyhavegeneration
if object_id('sp_MScomputelastsentgen','P') is not NULL
drop procedure sys.sp_MScomputelastsentgen
if object_id('sp_MSgetmaxbcpgen','P') is not NULL
drop procedure sys.sp_MSgetmaxbcpgen
if object_id('sp_MSgettablecontents','P') is not NULL
drop procedure sys.sp_MSgettablecontents
if object_id('sp_MSdelgenzero','P') is not NULL
drop procedure sys.sp_MSdelgenzero
if object_id('sp_MSmakedynsnapshotvws','P') is not NULL
drop procedure sys.sp_MSmakedynsnapshotvws
if object_id('sp_MSdropdynsnapshotvws','P') is not NULL
drop procedure sys.sp_MSdropdynsnapshotvws
if object_id('sp_MSgetdynsnapvalidationtoken','P') is not NULL
drop procedure sys.sp_MSgetdynsnapvalidationtoken
if object_id('sys.sp_MSscriptviewproc', 'P') is not null
drop procedure sys.sp_MSscriptviewproc
if object_id('sys.sp_MSenum_logicalrecord_changes', 'P') is not null
drop procedure sys.sp_MSenum_logicalrecord_changes
if object_id('sys.sp_MSget_logicalrecord_lineage', 'P') is not null
drop procedure sys.sp_MSget_logicalrecord_lineage
if object_id('sys.sp_MScheck_logicalrecord_metadatamatch', 'P') is not null
drop procedure sys.sp_MScheck_logicalrecord_metadatamatch
if object_id('sys.sp_MSset_logicalrecord_metadata', 'P') is not null
drop procedure sys.sp_MSset_logicalrecord_metadata
if object_id('sys.sp_MSdummyupdate_logicalrecord', 'P') is not null
drop procedure sys.sp_MSdummyupdate_logicalrecord
if object_id('sys.sp_MSgetmetadata_changedlogicalrecordmembers', 'P') is not null
drop procedure sys.sp_MSgetmetadata_changedlogicalrecordmembers
if object_id('sys.sp_MSgetdatametadatabatch', 'P') is not null
drop procedure sys.sp_MSgetdatametadatabatch
if object_id('sys.sp_MSmap_partitionid_to_generations', 'P') is not null
drop procedure sys.sp_MSmap_partitionid_to_generations
if object_id('sys.sp_MSmap_generation_to_partitionids', 'P') is not null
drop procedure sys.sp_MSmap_generation_to_partitionids
if object_id('sys.sp_MSget_gen_approx_changecount', 'P') is not null
drop procedure sys.sp_MSget_gen_approx_changecount
if object_id('sys.sp_MSupsertschemachange', 'P') is not null
drop procedure sys.sp_MSupsertschemachange
if object_id('sys.fn_MSgeneration_downloadonly', 'FN') is not null
drop function sys.fn_MSgeneration_downloadonly
if object_id('sys.fn_MSvector_downloadonly', 'FN') is not null
drop function sys.fn_MSvector_downloadonly
if object_id('sp_MSvalidatecommongen','P') is not NULL
drop procedure sys.sp_MSvalidatecommongen
if object_id('sp_MSvalidate_dest_recgen','P') is not NULL
drop procedure sys.sp_MSvalidate_dest_recgen
if object_id('sys.fn_MapColid', 'FN') is not null
drop function sys.fn_MapColid
if object_id('sys.fn_numberOf1InBinaryAfterLoc', 'FN') is not null
drop function sys.fn_numberOf1InBinaryAfterLoc
if object_id('sys.fn_numberOf1InVarBinary', 'FN') is not null
drop function sys.fn_numberOf1InVarBinary
if object_id('sys.sp_MSget_MSmerge_rowtrack_colinfo', 'P') is not null
drop procedure sys.sp_MSget_MSmerge_rowtrack_colinfo
if object_id('sys.fn_MSarticle_has_downloadonly_property', 'FN') is not null
drop function sys.fn_MSarticle_has_downloadonly_property
if object_id('sys.sp_MSfillup_deleted_cols', 'P') is not null
drop procedure sys.sp_MSfillup_deleted_cols
if object_id('sys.sp_MSget_shifted_colv1', 'P') is not null
drop procedure sys.sp_MSget_shifted_colv1
if object_id('sys.fn_IsTypeBlob', 'FN') is not null
drop function sys.fn_IsTypeBlob
if object_id('sys.fn_GetArticleSchemaVersionGuid', 'FN') is not null
drop function sys.fn_GetArticleSchemaVersionGuid
if object_id('sp_MScheck_article_auto_identity','P') is not NULL
drop procedure sys.sp_MScheck_article_auto_identity
if object_id('sp_MSsetup_identity_range','P') is not NULL
drop procedure sys.sp_MSsetup_identity_range
if object_id('fn_MSMerge_get_ranges_needed','FN') is not NULL
drop function sys.fn_MSMerge_get_ranges_needed
if object_id('sp_MSget_identity_range_info','P') is not NULL
drop procedure sys.sp_MSget_identity_range_info
if object_id('sp_MSallocate_new_identity_range','P') is not NULL
drop procedure sys.sp_MSallocate_new_identity_range
if object_id('sp_MSset_new_identity_range','P') is not NULL
drop procedure sys.sp_MSset_new_identity_range
if object_id('sp_MSsetreplicaschemaversion','P') is not NULL
drop procedure sys.sp_MSsetreplicaschemaversion
if object_id('fn_MSget_dynamic_filter_login','FN') is not NULL
drop function sys.fn_MSget_dynamic_filter_login
if object_id('fn_MSget_dynamic_filter_login_with_hostname','FN') is not NULL
drop function sys.fn_MSget_dynamic_filter_login_with_hostname
if object_id('sp_MSupdategenerations_afterbcp','P') is not NULL
drop procedure sys.sp_MSupdategenerations_afterbcp
if object_id('sp_MScreate_tempgenhistorytable','P') is not NULL
drop procedure sys.sp_MScreate_tempgenhistorytable
if object_id('sp_MSdrop_tempgenhistorytable','P') is not NULL
drop procedure sys.sp_MSdrop_tempgenhistorytable
if object_id('sp_MScheckfailedprevioussync','P') is not NULL
drop procedure sys.sp_MScheckfailedprevioussync