declare @t table(name varchar(),type int) insert into @t union all union all union all union all if object_id('test1') is not null drop table test1 create table test1( name varchar(), type int) insert into test1 union all union all union all union al…