RS First Dynamics NAV Blog


...from NAV 3.60 to NAV 2013
Archivio Posts
Anno 2015

Anno 2014

Anno 2013

Anno 2012

Anno 2011

Anno 2010

Anno 2009

Anno 2008

Anno 2007

Elenco oggetti contenuti in filegroup

 Articolo di Andrea Benedetti

Vediamo, con SQL Server 2005, un altro metodo in grado di "sbirciare" all'interno di un filegroup.

Ovvero: dato un nome di un filegroup voglio sapere gli oggetti (utente) contenuti al suo interno, quindi indici clustered (la tabella stessa), indici non clustered o statistiche, ecc...

 

declare @fileGroupName varchar(100)
set @fileGroupName = 'primary'

select object_name(obj.id) as Object,
ind.name as IndexName,
(case ind.indid
   when 0 then 'Heap'
   when 1 then 'Clustered'
   when 255 then 'text/image'
   else 'Non-clustered/Statistics'
end  ) as indexType
FROM sys.sysindexes ind
  join sys.sysobjects obj on ind.id = obj.id
  join sys.sysfilegroups grp on ind.groupid = grp.groupid
WHERE
   obj.type = 'U' and
   grp.groupname = @fileGroupName
order by Object

Categoria: Sql Server ALL
sabato, 28 apr 2007 Ore. 10.57

Messaggi collegati


Statistiche
  • Views Home Page: 457.851
  • Views Posts: 873.409
  • Views Gallerie: 0
  • n° Posts: 343
  • n° Commenti: 0
Copyright © 2002-2007 - Blogs 2.0
dotNetHell.it | Home Page Blogs
ASP.NET 2.0 Windows 2003