What's the difference between DELETE TABLE and TRUNCATE TABLE commands?
DELETE TABLE is a logged operation, so the deletion of each row gets logged in the transaction log, which makes it slow. TRUNCATE TABLE also deletes all the rows in a table, but it will not log the deletion of each row, instead it logs the de-allocation of the data pages of the table, which makes it faster. Of course, TRUNCATE TABLE can be rolled back.
Views
The SELECT clauses in a view definition cannot include the following:
- COMPUTE or COMPUTE BY clauses
- An ORDER BY clause, unless there is also a TOP clause in the select list of the SELECT statement
_____________________ The ORDER BY clause is used only to determine the rows that are returned by the TOP clause in the view definition. The ORDER BY clause does not guarantee ordered results when the view is queried, unless ORDER BY is also specified in the query itself. |
- The INTO keyword
- The OPTION clause
No comments:
Post a Comment