• subscribe
June 22, 2004 12:00 AM

Finding File-Creation Time

SQL Server Pro
InstantDoc ID #42904

Does SQL Server keep track of when new files and filegroups are added to or removed from a database, maybe in the form of a timestamp in the catalog? If so, how can I access that information?

SQL Server doesn't store file-creation times in the system tables. However, if you have a database file's full name, you can retrieve the file's creation time by using xp_getfiledetails:

EXEC master..xp_getfiledetails 'C:\Program Files\Microsoft SQL
Server\MSSQL$SQL2000_1\data\pubs.mdf'

The command's result set will tell you when the file was created, among other things. This technique won't work for retrieving filegroup creation times, however, because filegroups don't have a physical structure at the OS level. I don't know of any way to determine when a filegroup was created or when a particular file was added to a filegroup.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here
  • SP1?
    I know there is a SP1 for SQL 2008 R2 available....and there is a "feature pack" as well... ...
  • SQL database mirroring
    I have SQL Server 2008 R2 Enterprise 64bit on Windows 2008 R2 Enterprise 64bit.  Each SQL Server has...
  • Dell Compellent Disk Drive
    Does anybody has experience with Dell Compellent Disk Drive? Basically, this system manages all disk...
  • Sql server performance tuning
    I need to find a tool that help me to optimize sql server,queries,improve the performance and solve ...