Finding the size of the file

  • Hi ALL !

    From within a stored procedure I have to find out the size of a particular file. Is there a way to do it ?

    Actually the problem is in some cases zero bytes files are being created. In such cases I have to overwrite the files , but i dont know how to get the size of the file .

    Anybody who knows it, please help.

    Thanks in advance,                

    Rajesh

  • Try this one:

    exec master..xp_getfiledetails 'c:\autoexec.bat'

    Alternate Name                   Size        Creation Date Creation Time Last Written Date Last Written Time Last Accessed Date Last Accessed Time Attributes 

    -------------------------------- ----------- ------------- ------------- ----------------- ----------------- ------------------ ------------------ -----------

    NULL                             0           20030318      185915        20030318          185915            20030318           185915             32

    (1 row(s) affected)

     

    /Kenneth

  • Thanx a ton Kenneth !

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply