NigelRocks
asked on
If Statement Causing Problems
Experts,
I have a fairly long T-SQL script that works perfectly until I try to put in a simple If statement (see attached code).
When it test whether @!i is not equal to 96, the script hangs on me. Why would this be?
I have a fairly long T-SQL script that works perfectly until I try to put in a simple If statement (see attached code).
When it test whether @!i is not equal to 96, the script hangs on me. Why would this be?
SET @i = 81
while @i < 108
begin
if @i <> 96
Begin
INSERT INTO dbo.HRAGroupAnswer (HragqID, HraaoID, Gotogroupquestion)
VALUES (204, @i, NULL) -- Question 4
SET @i = @i + 1
end
end
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER