FIX: fn_virtualfilestats Skips the Last File (290916)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q290916
BUG #: 235019 (SHILOH_bugs)

SYMPTOMS

If a database consists of four or more files (any combination of data and log), the output of the following query may skip one of the files:
select * from ::fn_virtualfilestats(<db_id>, -1)
				

RESOLUTION

To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

STATUS

Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.

MORE INFORMATION

To reproduce the problem, execute the following code:
create database MultiFileDB on
(name='MultiFileDB1', filename='c:\MultiFileDB.mdf', size=1),
(name='MultiFileDB2', filename='c:\MultiFileDB2.ndf', size=1),
(name='MultiFileDB3', filename='c:\MultiFileDB3.ndf', size=1) log on
(name='MultiFileDBlog', filename='c:\MultiFileDB.ldf', size=1)
go
declare @var int
select @var = db_id('MultiFileDB')
select * from ::fn_virtualfilestats(@var, -1)
go
drop database MultiFileDB
go
				

Modification Type:MajorLast Reviewed:11/5/2003
Keywords:kbBug kbfix kbSQLServ2000sp1fix KB290916