create procedure sys.sp_MSenumschemachange_70(
@pubid uniqueidentifier,
@AlterTableOnly int,
@schemaversion int,
@compatlevel int
)
as
/*
** To public
*/
if (@schemaversion is null)
begin
RAISERROR(14043, 16, -1, '@schemaversion', 'sp_MSenumschemachange_70')
return (1)
end
if object_id('MSmerge_contents') is NULL
begin
RAISERROR(20054 , 16, -1)
return (1)
end
create table #temp_table_sp_MSenumschemachange_70
(pubid uniqueidentifier NULL,
artid uniqueidentifier NULL,
schemaversion int NULL,
schemaguid uniqueidentifier NULL,
schematype int NULL,
schematext nvarchar(2000) collate database_default null)
/* handle the case of reinitall */
if exists (select pubid from dbo.sysmergeschemachange where schemaversion > @schemaversion
and pubid = @pubid and schematype = 12)
select @schemaversion = 0
/*
** For 70 RTM and SP1, we want to filter out type 9 (retention propagation) and 16 (metadata cleanup)
** and 5 ( last rec generation ) and 6 (last sent generation)
** which they do not support. SP2 subscriber will be passing in 7000200, which gets understands
** these schema types
*/
insert into #temp_table_sp_MSenumschemachange_70
select pubid, artid, schemaversion, schemaguid, schematype, convert(nvarchar(2000), schematext) as schematext
from dbo.sysmergeschemachange where schemaversion > @schemaversion
and pubid = @pubid
and ((@compatlevel=7000000 and schematype in (-1, 1, 2, 3, 4, 7, 8, 10, 15, 20))
or (@compatlevel=7000200 and
((schematype in (-1, 1, 2, 3, 4, 7, 8, 9, 10, 12, 15, 16, 20,66))
or schematype in (5, 6) and @schemaversion = 0)))
order by schemaversion
-- Some schematypes that are distinct in Yukon used to have wrong number pre-Shiloh.
-- Map them back to the old values.
update #temp_table_sp_MSenumschemachange_70 set schematype=8 where schematype in (21,23)
update #temp_table_sp_MSenumschemachange_70 set schematype=9 where schematype = 18
/* for SP2 downlevel subscribers who do not understand type 12 (reinit-all) at provider level, but do
** at reconcile level, change it to type = 7 (directory) to be no-op.
*/
if @compatlevel=7000200
update #temp_table_sp_MSenumschemachange_70 set schematype=7 where schematype = 12
select * from #temp_table_sp_MSenumschemachange_70
drop table #temp_table_sp_MSenumschemachange_70
return (0)