G
Size: a a a
G
И
И
G
И
G
G
G
И
И
И
И
И
k
MC
set nocount on;
create table #numbers (id int identity (1,1) primary key, val1 float not null, val2 float);
declare @val1 float, @val2 float;
while (1=1)
begin
select @val1 = RAND(), @val2 = null;
insert into #numbers(val1)
values (@val1);
set @val2 = @val1;
update #numbers
set val2= @val2
where id = SCOPE_IDENTITY();
if SCOPE_IDENTITY()% 1000 = 0
print ('SCOPE_IDENTITY: ' + cast(SCOPE_IDENTITY() as char(8)))
if SCOPE_IDENTITY() > 1e7
break;
end
select
count(id) as total_qty
, count(case when val1 = val2 then 1 end ) as equals_qty
, count(case when val1 <> val2 then 1 end ) as not_equals_qty
from #numbers
--select * from #numbers;
G
set nocount on;
create table #numbers (id int identity (1,1) primary key, val1 float not null, val2 float);
declare @val1 float, @val2 float;
while (1=1)
begin
select @val1 = RAND(), @val2 = null;
insert into #numbers(val1)
values (@val1);
set @val2 = @val1;
update #numbers
set val2= @val2
where id = SCOPE_IDENTITY();
if SCOPE_IDENTITY()% 1000 = 0
print ('SCOPE_IDENTITY: ' + cast(SCOPE_IDENTITY() as char(8)))
if SCOPE_IDENTITY() > 1e7
break;
end
select
count(id) as total_qty
, count(case when val1 = val2 then 1 end ) as equals_qty
, count(case when val1 <> val2 then 1 end ) as not_equals_qty
from #numbers
--select * from #numbers;
k
MC
k