Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
desikankannan
Posting Yak Master
152 Posts |
Posted - 2008-03-25 : 12:51:26
|
Hi,i have 6 Records but i want to udpate only 3 recordsbelow with scenario "update tblautogen set acitve= y whereccode="G" BUT IT UPDATE ALL THE 6 RECORDS ACTIVE = Y BUT I NEEDUPDATE ONLY 3 RECORDS PLEASE GUIDE ME VERY VERY URGENTccode---couponno-----activeG-------5555555--------NG-------4444444--------NG-------6666666--------NG-------2222222--------NG-------DFDFFDF--------NDesikankannan |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-25 : 12:54:53
|
Which 3 records?You can use this:Set Rowcount 3update tblautogen set active= 'y' whereccode=''Set Rowcount 0 Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
desikankannan
Posting Yak Master
152 Posts |
Posted - 2008-03-25 : 14:44:29
|
hi iam doing this through .net there is not set rowcount conceptin .netDesikankannan |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-03-25 : 15:27:21
|
Try:-UPDATE t SET t.Active='Y'FROM(SELECT TOP 3 t.field1,t.field2,... FROM Table where ccode='G')t |
 |
|
|
|
|