horizontal partitioning of table

  • Can I create a table and place it under 2 filesgroups, and specify based on a condition (like year >= 2000 or < 2000) to make the data go to the different filegroups?Can help is greatly appreciated.

  • You can use a Partitioned View. You would create two tables each with a check constraint on the year column. Then you create a view unioning the two tables together with a union all. The optimizer is smart enough when selecting to select from the correct table if you supply year in the where clause. The insert into the view would automatically put the data into the correct table. Believe it or not an update to a row changing the year column would also move the row from one table to the other if it needed too. BOL has lots of info on this. Hope this helps.

  • Thanks for the info. I will try.

    What and where is BOL ? I see everyone talking about it in this board.

  • Books Online. If you don't have it installed, you should be able to get it off of the cd you installed SQL Server from. It's actually probably online as well, but I don't know the link. I am sure someone else does.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply