[dba-SQLServer] Really Interesting puzzle

Mark A Matte markamatte at hotmail.com
Mon Oct 6 10:02:13 CDT 2008


Arthur,

I have a system that generates letters and postcards...every night it receives a text file for letters to be processed.  The users process twice a week...and it needs to be in order.  I'm assuming the numbers in the example you gave are a date.  In the file I receive, the date is part of the file name.  My system nows what files contained what data and when  processed...a file should be generated every day...so by looking at the date part of the name...the system always knows what file should be processed next.

Not sure if it helps...just the approach I use.

Thanks,

Mark

> Date: Fri, 3 Oct 2008 17:09:54 -0300
> From: fuller.artful at gmail.com
> To: dba-sqlserver at databaseadvisors.com
> Subject: Re: [dba-SQLServer] Really Interesting puzzle
>
> Ok I have all the glitches sorted out. It required a change or two on the
> incoming side (creation of the source files from the stream) and a change or
> two on the destination side, but we're there. On to the next problem...
>
> The c++ program reads the stream and periodically writes an ascii file,
> which I then inhale using Bulk Insert. This part is insanely fast, I can't
> believe how fast it is. The c++ part creates an in-memory database and then
> periodically writes an ascii file. At that point, I grab the file and to the
> bulk insert. Although the insert only takes seconds, it could well happen
> that more ascii files appear. So the directory may at any moment contain N
> files, to be processed in sequence. The current plan is to grab the first
> file, inhale it, move it to another directory, and repeat.
>
> The files are going to have names such as xxx_20081103_01.csv. And then 02
> and so on.
>
> I'm pondering how to know the next file to open. I suppose that if I read
> the directory list sorted by name or date that will give me the earliest
> file, and then I can just pass that name to the sproc that calls Bulk
> Insert. But before I code it, I thought to ask you wizards if you can see
> any holes in this approach.
>
> TIA,
> Arthur
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>

_________________________________________________________________
Get more out of the Web. Learn 10 hidden secrets of Windows Live.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008



More information about the dba-SQLServer mailing list