Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_helpfilegroup

  No additional text.


Syntax
create procedure sys.sp_helpfilegroup
@filegroupname sysname = NULL		/* filegroup name or all filegroups */
as

set nocount on
-- status & 0x40 is a log file and thus not in any filegroup
if @filegroupname IS NULL
begin
	select 	g.groupname,  g.groupid, 'filecount' =
		(select count(*) from sysfiles f
			where f.groupid = g.groupid
				and (f.status & 0x40 <> 0x40))
	from sysfilegroups g
end
else
begin
	if (filegroup_id(@filegroupname) IS NULL)
	begin
		raiserror (15325, -1, -1, 'filegroup', @filegroupname)
		return (1)
	end
	select 	g.groupname,  g.groupid, 'filecount' =
		(select count(*) from sysfiles f
			where f.groupid = g.groupid
				and (f.status & 0x40 <> 0x40))
	from sysfilegroups g
	where g.groupid = filegroup_id(@filegroupname)

	select 	'file_in_group' = name,  fileid, filename,
	'size' = convert(nvarchar(15), size * 8) + N' KB',
	'maxsize' = (case maxsize when -1 then N'Unlimited'
			else
			convert(nvarchar(15), maxsize * 8) + N' KB' end),
	'growth' = (case status & 0x100000 when 0x100000 then
		convert(nvarchar(3), growth) + N'%'
		else
		convert(nvarchar(15), growth * 8) + N' KB' end)
	from sysfiles
	where groupid = filegroup_id(@filegroupname)
	and (status & 0x40 <> 0x40)
	order by fileid
end

return (0) -- sp_helpfilegroup

 
Last revision 2008RTM
News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash