create table #t(
a varchar(6),
b varchar(8)
)
insert into #t select top 1000 left(newid(),6),left(newid(),8) from sysobjects a,sysobjects b
select * from #t
drop table #T
a varchar(6),
b varchar(8)
)
insert into #t select top 1000 left(newid(),6),left(newid(),8) from sysobjects a,sysobjects b
select * from #t
drop table #T
select top 1000 left(col,6) a,identity(int,1,1) id into #ta from
(select replace(newid(),'-','') col from sysobjects a,sysobjects b) t
group by left(col,6)
select top 1000 left(col,8) b,identity(int,1,1) id into #tb from
(select replace(newid(),'-','') col from sysobjects a,sysobjects b) t
group by left(col,8)select #ta.a,#tb.b from #ta,#tb where #ta.id=#tb.id
drop table #ta,#tb
create table #t(
a varchar(6),
b varchar(8),
c varchar(8)
)
insert into #t (a,b,c) select distinct top 1000 left(newid(),6),left(newid(),8),b.a from sysobjects a,(select 'a' as a from sysobjects) b
select a,b from #t
drop table #T
select distinct top 1000 left(newid(),6) a,left(newid(),8) b
from sysobjects a,sysobjects b
declare @counter int
set @counter=0
while @counter<1000
begin
insert into @tb select left(newid(),6) ,left(newid(),8)
set @counter=@counter+1
end
select * from @tb