Try something like this:
-- declaration
declare @counter int,
@MaxId int,
@Rows int
select @counter=0 -- start position
select @Rows=10000 -- how many rows do you want to update in one time
select @MaxId = count(*)
from tab
-- updating in loop
while @counter<@MaxId+@Rows
begin
update tab
set col1 = 'val'
where id between @counter and @counter+@Rows-1
select @counter=@counter+@Rows
end
go
EDIT:
If table tab
hasn't got Unique
or PK
column than you could add an identity
column as below
alter table tab
add id numeric(10,0) identity
than you can run above solution.