Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_helpfile

  No additional text.


Syntax
create procedure sys.sp_helpfile
@filename sysname = NULL			/* file name or all files */
as

set nocount on

if @filename IS NULL
begin
select 	name,  fileid, filename,
	filegroup = filegroup_name(groupid),
	'size' = convert(nvarchar(15), convert (bigint, size) * 8) + N' KB',
	'maxsize' = (case maxsize when -1 then N'Unlimited'
			else
			convert(nvarchar(15), convert (bigint, maxsize) * 8) + N' KB' end),
	'growth' = (case status & 0x100000 when 0x100000 then
		convert(nvarchar(15), growth) + N'%'
		else
		convert(nvarchar(15), convert (bigint, growth) * 8) + N' KB' end),
	'usage' = (case status & 0x40 when 0x40 then 'log only' else 'data only' end)
	from sysfiles
	order by fileid

end
else
begin
	if file_id(@filename) IS NULL
	begin -- no such file
		raiserror (15325, -1, -1, 'file', @filename)
		return (1)
	end
	select 	name,  filename,
	filegroup = filegroup_name(groupid),
	'size' = convert(nvarchar(15), convert (bigint, size) * 8) + N' KB',
	'maxsize' = (case maxsize when -1 then N'Unlimited'
			else
			convert(nvarchar(15), convert (bigint, maxsize) * 8) + N' KB' end),
	'growth' = (case status & 0x100000 when 0x100000 then
		convert(nvarchar(3), growth) + N'%'
		else
		convert(nvarchar(15), convert (bigint, growth) * 8) + N' KB' end),
	'usage' = (case status & 0x40 when 0x40 then 'log only' else 'data only' end)
	from sysfiles
	where fileid = file_id(@filename)
	order by fileid
end

return (0) -- sp_helpfile

 
Last revision 2008RTM
See also

  sp_helpdb (Procedure)
sp_helpfilegroup (Procedure)
       



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