Friday, March 30, 2012

Modified Date of a file

Hi All,
Think this must be pretty easy to do but can't find the commands anywhere... how can i use T-SQL to find the modified date of a particular file (say c:\temp\test.out) ?
Thanks
JohnYou could use extended sp xp_getfiledetails or xp_cmdshell to check info about file. If you need use this information late - save it in table.

insert mytable--table has to have structure according to sp recordset.
master..xp_cmdshell "dir c:\myfile.zip"

insert mytable--table has to have structure according to sp recordset.
master..xp_getfiledetails "c:\myfile.zip"|||Thanks Snail, worked a treat

No comments:

Post a Comment