任何人都可以在mssql中为此提供教程或完整脚本:
exec up_AddMyCashItemByItem 'usernum','0','1','1','1','0'
我想自动使用usernum直到最后一行计数!
所以应该自动执行此操作。
exec up_AddMyCashItemByItem '1','0','1','1','1','0'
exec up_AddMyCashItemByItem '2','0','1','1','1','0'
exec up_AddMyCashItemByItem '3','0','1','1','1','0'
直到给定表的最后一行到达!
答案 0 :(得分:3)
DECLARE @currentVal INT = 1, @maxVal INT = 4000;
WHILE @currentVal <= @maxVal
BEGIN
EXEC up_AddMyCashItemByItem @currentVal,'0','1','1','1','0';
SET @currentVal = @currentVal + 1;
END;