|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Tables and File Groups
Hi everybody
I need query that will determine which tables are created on primary file group or secondary file group... I know that i can exectute sp_help 'tablename' to see on which file group the only one table is. But i have 2000 tables and it is very slow to execute sp_help for every table. alex |
|
#2
|
|||
|
|||
|
select distinct G.groupname, (object_name(id)),
I.rows, (I.reserved * 8 ) AS KB from sysfilegroups G inner join sysindexes I on G.groupid=I.groupid WHERE (I.indid ='0' or I.indid='1') AND LEFT((object_name(id)),3)<> 'sys' AND LEFT((object_name(id)),6)<> 'dtprop' order by G.groupname, (I.reserved * 8 ) DESC, (object_name(id)) |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Tables and File Groups |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|