新手请教格问题-为什么调用存储过程报错
为什么在存储过程中 有INSERT 语句,报表执行调过程就报错,若把 DELETE和 INSERT 段注释掉,报表调过程就OK.过程如下
CREATE PROC SPC_CREATE
@NUM INT
AS
DECLARE @MINID INT
DECLARE @I INT
SET @I=1
DELETE FROM SPCTEST1
WHILE @I<=@NUM
BEGIN
INSERT INTO SPCTEST1(D1,D2,D3)
SELECT CEILING(RAND()*10),CEILING(RAND()*10),CEILING(RAND()*10)
SET @I=@I+1
END
SELECT ID,D1,D2,D3 FROM SPCTEST1