DECLARE @role varchar(50) DECLARE CusCursor CURSOR FOR select RoleName from aspnet_Roles OPEN CusCursor FETCH NEXT FROM CusCursor INTO @role WHILE (@@FETCH_STATUS = 0) BEGIN SELECT @role --这里写SQL语句 FETCH NEXT FROM CusCursor INTO @role END CLOSE CusCursor DEALLOCATE CusCursor