ALTER PROCEDURE GetFileSize @FileName varchar(8000)
--@FileName is relative to the SQL Server
AS
BEGIN
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 @FileName
SELECT @FileName as file_name, size_in_bytes FROM #info
DROP TABLE #info
END