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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 affected many row

Author  Topic 

wormz666
Posting Yak Master

110 Posts

Posted - 2010-03-08 : 20:28:59
update table1 set field1=@field1 where prifield in(Select prifield from table2 where stat='Deactivated')

i' having an error on it...
to many row's affected....

finding the truth
making a maze on my mind....

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-03-08 : 20:44:48
run this and see what are the extra rows that you do not want to update it and add the condition accordingly to the WHERE clause

select *
from table1
where prifield in(Select prifield from table2 where stat='Deactivated')



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2010-03-09 : 00:01:46
i want to update many row... as a transaction been related to the primary key...

finding the truth
making a maze on my mind....
Go to Top of Page

wormz666
Posting Yak Master

110 Posts

Posted - 2010-03-09 : 00:03:03
i know which field should i update... the related row and and its status should be deactivated...

finding the truth
making a maze on my mind....
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-03-09 : 00:14:18
can you post some sample data and explain the problem you are facing ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -