我正在尝试迭代地设置表变量的各个列,如下所示:
declare @reg_data table
(
I int NOT NULL PRIMARY KEY IDENTITY,
Y float
)
declare @counter int, @numRows int
SET @counter = 0
SET @numRows = (select MAX(val) + 10 from tableY)
WHILE @counter < numRows
BEGIN
SET @reg_data.Y = dbo.func1(@counter) --HOW DO I DO THIS!!!
@counter = @counter + 1
END
以上不起作用,因为您无法访问像数组这样的表变量。如何获得以下功能?