34,587
社区成员
发帖
与我相关
我的任务
分享
CREATE TABLE AB(
[a] int,
[b] int
)
GO
declare @a int
set @a = 1
declare @b int
set @b = 1
while @a < 10
begin
while @b<10
begin
insert into AB values
(@a,@b)
set @b+=1
end
set @a+=1
end
GO
select * from AB
DECLARE @AB TABLE (
[a] int,
[b] int
)
DECLARE @a INT,@b int
SET @a = 1
WHILE @a<=9
BEGIN
SET @b=1
WHILE @b<=9
BEGIN
INSERT INTO @AB VALUES
(@a,@b)
SET @b=@b+1
END
SET @a=@a+1
END
SELECT * FROM @AB
CREATE TABLE #AB(
[a] int,
[b] int
)
GO
declare @b int
declare @a INT
set @a = 1
set @b = 1
while @a < 10
BEGIN
SET @b=1
while @b<10
begin
insert into #AB values
(@a,@b)
set @b+=1
end
set @a+=1
end
GO
select * from #AB
DROP TABLE #AB