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-04-03 : 08:27:13
|
hi,i try to update first two rows based on the conditions but its not wroking UPDATE tblautogen SET fldactive = 'Y' from (SELECT TOP 2 fldcouponno FROM tblautogen WHERE fldccode = 'D') tblautogen shows the error Invalid column name 'fldactive' but i have this field fldactiveDesikankannan |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-03 : 08:31:10
|
[code]Update t1set fldactive = 'Y' From tblautogen t1 JOIN (SELECT TOP 2 fldcouponno FROM tblautogen WHERE fldccode = 'D') T2ON T1.fldcouponno = T2.fldcouponno[/code]or[code]SET ROWCOUNT 2UPDATE tblautogen SET fldactive = 'Y' WHERE fldccode = 'D'SET ROWCOUNT 0[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|