• Thanks Lynn for the code. Yes, I think you paraphrased it pretty well. The moving around of the file is the file and it's data being processed and moved to different directory. An analogy would be a TCP/IP packet along its journey across different points of a network. Each "hop" being a point where the file is processed and forwarded on. The ID of the file is captured at creation (when it comes into the FTP site). I want a identifying number for that initial file as I record each "hop" along its jouney. In short like this (many more data in columns will be capture):

    ID FileName Directory Event

    2001 Somefile_Renamed.txt \\server\dir Renamed

    2001 Somefile.txt \\server\dir Deleted

    2001 Somefile.txt \\server2\dir2 Created

    I went ahead a created a Master type table that will capture the initial file creation on the FTP site. This table will created the ID via IDENTITY(1,1). I then will populate the table I depict above from that ID and record each event as it unfolds.

    Lynn Pettis (4/4/2012)


    Actually, I got this to work with no problem.

    ALTER PROC dbo.sp_GetMaxID (@MaxID INT OUTPUT)

    AS

    BEGIN

    SELECT @MaxID = max(ID) + 1 FROM tblFileWatchMaxID;

    END

    Use the same test code from my post above.

    A clever person solves a problem. A wise person avoids it. ~ Einstein
    select cast (0x5365616E204465596F756E67 as varchar(128))