Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
noamg
Posting Yak Master
215 Posts |
Posted - 2009-09-02 : 03:19:12
|
| I have a partition table, with few filegroups.how to know into which filegroup SQL write the new row ?Noam Graizer |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2009-09-02 : 04:22:01
|
| It depends on the definition of your Partition Function. And you can use this query to check:SELECT $PARTITION.MYPARTITIONFUNCTION(100) [PARTITION NUMBER]Lookup $PARTITION in BOL |
 |
|
|
noamg
Posting Yak Master
215 Posts |
Posted - 2009-09-02 : 04:43:24
|
| I ask into which FILEGROUP the row will be inserted !?Noam Graizer |
 |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2009-09-02 : 10:06:24
|
| $PARTITION will give you the partition id and this query will give the associated filegroup:select ds.name AS [Filegroup Name], destination_id AS [partition number]from sys.data_spaces ds inner join sys.destination_data_spaces dds on (ds.data_space_id = dds.data_space_id)inner join sys.partition_schemes ps on (ps.data_space_id = dds.partition_scheme_id)order by ds.name ASCHave a look at the other partition related catalog views in BOL. |
 |
|
|
|
|
|