|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
how i can update only certain records within a table
<i><b>Originally posted by : Simon Parry (simon@cbox.co.uk)</b></i><br /><br />Can somebody tell me how i can update only certain records within a table. For example<br /><br />i have a table Customerid, product, reserved<br />the reserved field is either (yes/no)<br /><br />a customer has the option of reserving a batch of products, i.e 7 products, i need to find a way of just updating 7 records instead of them all for a particular customer.<br /><br />this is the statement i am using at the moment<br /><br />UPDATE numbers<br />SET reserved ='Yes' , Customerid =custno<br />WHERE type = 'bannana', reserved ='No'<br /><br />this updates all of the records
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Ramesh.B (ramesh_bhanu@yahoo.com)</b></i><br />Use can Use The SET ROWCOUNT 7 FOr The Purpose<br /><br />Like,<br /><br />SET ROWCOUNT 7<br />UPDATE numbers<br />SET reserved ='Yes' , Customerid =custno<br />WHERE type = 'bannana', reserved ='No'<br />SET ROWCOUNT 0<br /><br /><br />------------<br />Simon Parry at 10/13/2000 4:40:40 AM<br /><br /><br />Can somebody tell me how i can update only certain records within a table. For example<br /><br />i have a table Customerid, product, reserved<br />the reserved field is either (yes/no)<br /><br />a customer has the option of reserving a batch of products, i.e 7 products, i need to find a way of just updating 7 records instead of them all for a particular customer.<br /><br />this is the statement i am using at the moment<br /><br />UPDATE numbers<br />SET reserved ='Yes' , Customerid =custno<br />WHERE type = 'bannana', reserved ='No'<br /><br />this updates all of the records
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > how i can update only certain records within a table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|