Skip navigation

How can I get file information using SQL Server?

A. Using the undocumented xp_getfiledetails procedure :-

create table #info ( 
alt_name varchar(255) null, 
size_in_bytes int null, 
creation_date int null,
creation_time int null,
last_written_date int null,
last_written_time int null,
last_accessed_date int null,
last_accessed_time int null,
attributes int null

insert #info exec master..xp_getfiledetails 'C:\Directory\File.nam'

TAGS: SQL Server
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.