xp_filesize

  • Hi,

    I'm new in stored procedures and I would need some help.

    The problem is that I need to know the size of a csv file to now when it becomes bigger. When that hapens, I have to bulk the file into the data base.

    I have tried with this to make a test:

    EXEC xp_filesize @Filename, @filesize OUTPUT

    PRINT @filesize

    And when I execute the stored procedure it apears that warning in spanish:

    You can't add rows to sysdepends for the actual object because it depends on 'xp_FileSize' object, that is missing. Anyway, the object would be created

    And the following error

    The 'xp_FileSize' hasn't been found.

    What sould I do? It would be gratefull if you could answer me as soon as you can to etxeb@hotmail.com. Thanks in advance!!!!:D

  • I believe error message says it all.

    Procedure xp_filesize does not in you database indeed.

    But there is one in master database.

    In order to call it you need to qualify SP name with database name:

    EXEC master.dbo.xp_filesize @Filename, @filesize OUTPUT

    _____________
    Code for TallyGenerator

  • Is xp_filesize a built-in stored procedure?

    Have you installed xpFileUtils.DLL?

  • My boss has told me to not install that library. So I am trying to do it in another way. He has told me to do it with incremental bulk but I can't find anything interesting on the internet. Just, BULK INSERT (that it seems that is the fastest way). But nothing according to "incremental".

    Our objective is to bulk one csv file at the beginning and after that, each second but only the rows that are changed on the csv file.

    I'm not sure if it can be possible not knowing the file size.

  • Without installing the dll it gives me the same error using

    EXEC master.dbo.xp_filesize @Filename, @filesize OUTPUT

    It's normal for SQL SERVER 2005 to not have that dll?

    Anyway, do you know how many miliseconds is necesary to get the file size? I have written below the necesary code to test that. Could someone test it using that dll?

    DECLARE @start datetime

    SET @start = getdate()

    EXEC master.dbo.xp_filesize @Filename, @filesize OUTPUT (or whatever)

    select getdate() - @start as ElapsedTime

    Depending on how long it takes, I would have to install that dll or continue doing the bulk each second.

    Thank you

    😛

Viewing 5 posts - 1 through 4 (of 4 total)

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