Saturday, February 25, 2012

Re-order table after many inserts

I have a stored proc that is long and performs many separate intserts into my table. Is there a way that I can reorder the records themselves physically in the table after the inserts are done?

Hello,

http://weblogs.sqlteam.com/tarad/archive/2004/07/30/1834.aspx

I think this will help you!

Happy coding...

|||

Hi,

I don′t know if the article below is applying to your case, but this can be only done if you have a clustered key based on the tables, which is defining the physical o′rder of a key, and therefore the physical order of the table (based on x columns). But if you only want to sort the tables via a specific column, then you have to look a bit deeper in the specifications of a table. Its a unordered set of data, unless you don′t have a clustered sorted index on a it, you will only get the orderd data with querying the data with the ORDER clause.

HTH, Jens Suessmeyer.

No comments:

Post a Comment