Tcl, 110104 bytes
set i 2
time {set p 1;set j 2;while \$j<$i {if $i%$j==0 {set p 0;break0};incr j};if $p {puts $i};incr i} 999998
Unfortunately I could not find an online Tcl interpreter which does not time out running it.
set i 2
time {set p 1;set j 2;while \$j<$i {if $i%$j==0 {set p 0;break};incr j};if $p {puts $i};incr i} 999998
set i 2
time {set p 1;set j 2;while \$j<$i {if ![expr $i%$j] {set p 0;break};incr j};if $p {puts $i};incr i} 999998
#tcl, 201
My still not golfed answer:
for {set i 2} {$i<$1000000} {incr i} {
set p 1
for {set j 2} {$j<$i} {incr j} {
if {[expr $i%$j] == 0} {
set p 0
break
}
}
if $p {puts $i}
}