Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- drop table Test_Partitioning;
- drop partition scheme Test_Partition_Scheme;
- drop partition function Test_Partition_Function;
- create partition function Test_Partition_Function (datetime)
- as range left for values (null);
- create partition scheme Test_Partition_Scheme
- as partition Test_Partition_Function
- all to ([PRIMARY]);
- create table Test_Partitioning (
- id int not null,
- stamp datetime null
- ) ON Test_Partition_Scheme (stamp);
- insert into Test_Partitioning values (1, '2001-01-01');
- insert into Test_Partitioning values (2, null);
- SELECT
- $partition.Test_Partition_Function(t.stamp) AS [Partition Number],
- t.*
- FROM
- Test_Partitioning t
- /*
- Partition Number id stamp
- 1 2 NULL
- 2 1 2001-01-01 00:00:00.000
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement