Update top N record in SQL Server
Disclaimer : This tutorial is meant for beginners and for anyone who find it useful. The main purpose of this post to keep everything i find useful for future reference for myself and for others.
SQL statement to update top N records
update daily_sales set is_calc='Y' from daily_sales inner join (select top 100 * from daily_sales where product_category='CA') a on a.unique_record_id=daily_sales.unique_record_id and a.milestone_code=daily_sales.milestone_code
Source is SQLServerCentral

I am an organism that turns coffee into software 

4 responses to "Update top N record in SQL Server"
Thanks for posting, I’ll definitely be subscribing to your blog.
You can just use
update top(100) daily_sails
…
…
Thanks Maxim Fateev.
Its seems much simpler solution. Thanks for sharing!
Thanks for sharing, it was helpful.
Leave a comment