I am just wondering if I can maintain the order of insertion of data in SQL Server?
I am working on my own project and it is kind of blog site having a number of pos
When you specify ORDER BY
in an INSERT...SELECT
statement, SQL Server will assign IDENTITY
values in the order specified. However, that does not mean rows are necessarily inserted in that order.
If you need rows returned in a specific order, you must use ORDER BY
to guarantee ordering. Indexes can be leverage provide order data efficiently depending on the query particulars.