我正在尝试为矩阵生成一组行,但@xcolcount
唯一的 on 循环保持为零,而内部循环执行它需要的操作:
Declare @xColCount int
Declare @yRowCount int
set @xColCount = 0
set @yRowCount = 0
WHILE (@xColCount < @widthCol)
BEGIN
WHILE (@yRowCount < @heightRow)
BEGIN
-- do the insert
INSERT
INTO Scenario.MapCell(Guid, Map, Col, ColAplha, Row)
VALUES (newID(), @mapGuid, @xColCount, 'A', @yRowCount)
SET @yRowCount = @yRowCount + 1
END
SET @xColCount = @xColCount + 1
END