Enten...
FETCH NEXT FROM myCursor INTO @ContactName
WHILE @@FETCH_STATUS = 0
BEGIN
-- do stuff
FETCH NEXT FROM myCursor INTO @ContactName
END
Eller...
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH NEXT FROM myCursor INTO @ContactName
IF @@FETCH_STATUS = 0
BEGIN
-- do stuff
END
END
Eller...
WHILE (1 = 1)
BEGIN
FETCH NEXT FROM myCursor INTO @ContactName
IF @@FETCH_STATUS <> 0
BREAK
-- do stuff
END