SQL Server根据分区表名查找所在的文件及文件组实现脚本
程序员文章站
2023-01-03 14:49:31
select ps.name as psname,
dds.destination_idas partitionnumber,
fg.name as...
select ps.name as psname, dds.destination_idas partitionnumber, fg.name as filegroupname,fg.name, t.name, f.name as filename from (((sys.tables as t inner join sys.indexes as i on (t.object_id = i.object_id)) inner join sys.partition_schemes as ps on (i.data_space_id = ps.data_space_id)) inner join sys.destination_data_spacesas dds on (ps.data_space_id = dds.partition_scheme_id)) inner join sys.filegroups as fg ondds.data_space_id =fg.data_space_id innerjoin sys.database_files f on f.data_space_id = fg.data_space_id where t.name='salesorder'
上一篇: 无线网络IP地址发生矛盾的解决之道
下一篇: 霍去病到底有多厉害?一生事迹堪比小说