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 |
|
pras2007
Posting Yak Master
216 Posts |
Posted - 2009-06-09 : 21:37:46
|
| Hello All,I want to update the first record order by the newest record. The below SQL is what I wrote which was giving me this error: Msg 156, Level 15, State 1, Line 4Incorrect syntax near the keyword 'order'.QueryUPDATE TOP (1) edge_etl_batch SET Audit_Ind = 1order by BatchDate DESCPlease advice. Thanks. |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-06-10 : 00:55:21
|
try like thisupdate tset Audit_Ind = 1from (select top 1 Audit_Ind from edge_etl_batch order by BatchDate desc )tselect * from edge_etl_batch |
 |
|
|
|
|
|