Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. CREATE PARTITION FUNCTION pfTest(int) AS RANGE LEFT FOR VALUES (10, 20, 30);
  2. CREATE PARTITION SCHEME psTest AS PARTITION pfTest TO ([GRP1], [GRP2], [GRP3]);
  3.  
  4. ALTER PARTITION FUNCTION pfTest() SPLIT RANGE (40);
  5. ALTER PARTITION SCHEME psTest NEXT USED [GRP4];
  6.  
  7. --- Create the partition function:
  8. CREATE PARTITION FUNCTION fn_part_left(int)
  9. AS RANGE LEFT FOR VALUES (100, 110, 120, 130);
  10.  
  11. --- Create the partition scheme:
  12. CREATE PARTITION SCHEME ps_part_left AS
  13. PARTITION fn_part_left TO
  14. ([GROUP_A], [GROUP_B], [GROUP_C], [GROUP_A], [GROUP_B]);
  15.  
  16. --- Create the table
  17. CREATE TABLE myTable (
  18. someColumn int NOT NULL,
  19. ....
  20. ) ON [ps_part_left](someColumn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement