processing wildcard files

  • I get files ftp'ed to me with date stamps.

    I need to have an unattended import ( have built then for single files so I all set there)

    I can get the following to return what I need.

    declare @SQL_Command char(250)

    SET @SQL_Command = 'exec Master.dbo.xp_cmdshell "dir /b \\cronus\y\ftp\inbound\NW_PLCYDTL*.dat "'

    EXEC (@SQL_Command)

    NW_PLCYDTL_20090305.dat

    NW_PLCYDTL_20090310.dat

    NW_PLCYDTL_20090311.dat

    NULL

    but not one at a time.

    so the process would be

    1) get list of files to process one at a time ( can get list but not one at a time)

    2) rename NW_PLCYDTL_20090305.dat to NW_PLCYDTL ( got this working)

    3) import NW_PLCYDTL into sql database ( got this working)

    4) repeat step 1,2, 3 till no files left. ( assume that this will be part of answer for step 1 - if eof ...)

  • This should help:

    http://www.sqldts.com/246.aspx

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

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