You can’t DELETE TOP (x) with an ORDER BY
'Did you know you can’t do this?
1
2
3
|
DELETE TOP (10)
FROM SalesOrderDetail
ORDER BY SalesOrderID DESC;
|
Msg 156, Level 15, State 1, Line 8
Incorrect syntax near the keyword ‘ORDER’.
I didn’t. Until I tried it anyway. Turns out, it says so right in the limitations section of BOL. Fortunately, that same section does have a recommendation on how to move forward.'...
https://sqlstudies.com/2018/09/19/you-cant-delete-top-x-with-an-order-by/
Trackbacks
Die Kommentarfunktion wurde vom Besitzer dieses Blogs in diesem Eintrag deaktiviert.
Kommentare
Ansicht der Kommentare: Linear | Verschachtelt