WITH q AS
(
SELECT TOP 10 *
FROM messages
WHERE status = 0
ORDER BY
priority DESC
)
UPDATE q
SET status = 10
More Related Contents:
- How can I do an UPDATE statement with JOIN in SQL Server?
- SQL update query using joins
- When no ‘Order by’ is specified, what order does a query choose for your record set?
- how can I Update top 100 records in sql server
- I want to use CASE statement to update some records in sql server 2005
- Update query using Subquery in Sql Server
- how does SELECT TOP works when no order by is specified?
- SQL where clause odd behavior [closed]
- How do I obtain a Query Execution Plan in SQL Server?
- How do I escape a single quote in SQL Server?
- Only inserting a row if it’s not already there
- Unpivot with column name
- Selecting data from two different servers in SQL Server
- Most efficient way in SQL Server to get date from date+time?
- Generate SQL Create Scripts for existing tables with Query
- How to rewrite IS DISTINCT FROM and IS NOT DISTINCT FROM in SQL Server 20008R2?
- How do I delete from multiple tables using INNER JOIN in SQL server
- SQL : BETWEEN vs =
- How do I perform a GROUP BY on an aliased column in SQL Server?
- Need to list all triggers in SQL Server database with table name and table’s schema
- Count based on condition in SQL Server
- Is it possible to perform multiple updates with a single UPDATE SQL statement?
- Best equivalent for IsInteger in SQL Server
- Syntax of for-loop in SQL Server
- How to correctly insert newline in nvarchar [duplicate]
- How do you copy a record in a SQL table but swap out the unique id of the new row?
- Using IF ELSE statement based on Count to execute different Insert statements
- Sql Server : How to use an aggregate function like MAX in a WHERE clause
- Date serial in SQL?
- SQL Server: +(unary) operator on non-numeric Strings