好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

SQL Server根据分区表名查找所在的文件及文件组实现脚本

mwsltlG

SELECT ps.name AS PSName,  
 dds.destination_idAS PartitionNumber, 
  fg.name AS FileGroupName,fg.name,  python  
  t.name,
  f.name as filename
  FROM (((sys.tables AS t  
  INNER JOIN sys.index  js  es 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
       innerjoi python n sys.database_files f on f.data_space_id = fg.data_space_id
      where t.name='salesOrder'

查看更多关于SQL Server根据分区表名查找所在的文件及文件组实现脚本的详细内容...

  阅读:16次