tags:

views:

3318

answers:

3

Hi Guys,

I want to update Top 100 records in sql server . I have a table T1 with fields F1 and F2. T1 has 200 records. I want to update F1 field of Top 100 records. How can i can update in sql server.

Thanks Rajesh

+4  A: 

update top (100) table1 set field1 = 1

Umair Ahmed
A: 

It will work in sql 2005 but not in sql 2000. please mention.

Sreenivas
A: 

update tb set f1=1 where id in (select top 100 id from tb where f1=0)

hyyxing