Gerrit Mantel
Programs SQL_SCALAR_FUNCTION - fun_FileProperty_DateLastModified

Main program

Namefun_FileProperty_DateLastModified
Type_descSQL_SCALAR_FUNCTION
CommentSQLServer User-Defined Function

PURPOSE
Return the Date last modified of a given file.

If the dateformat (sShortDate) in the users's registry is not known,
or has an unknown format, the default english dateformat M/d/yyyy
is used to convert the date string. SQL Server can throw an error on this.

Return value (DATETIME):
NULL - File does not exist
datetime - Lastmodified date of the file

EXAMPLES
SELECT dbo.fun_FileProperty_DateLastModified ('D:\MSSQL\Genre.txt')
2014-10-20 16:42:47.000

SELECT dbo.fun_FileProperty_DateLastModified ('C:\does not exist.txt')
NULL

HISTORY
2000-01-01 - Created function
2015-11-17 - The sShortDate registry value is now used to convert date string
2024-02-09 - Changed history table

TAGS
<program>
<description>Return the date created of a given file</description>
<generic>1</generic>
<author>Gerrit Mantel</author>
<created>2000-01-01</created>
<lastmodified>2024-02-09</lastmodified>
</program>
DescriptionReturn the date created of a given file
Minversion
Generic1
AuthorGerrit Mantel
Created2000-01-01 00:00:00
Lastmodified2024-02-09 00:00:00
Xp_cmdshell0
Ole_automation1
Subprogram_cnt0
Sourcecode