December 14, 2005 at 9:26 pm
So, how I can get this code to work with a wildcarded filename?:
SELECT *
INTO Project01tmp
FROM OpenRowSet{'MSDASQL', 'Driver=(Microsoft dBASE Driver (*.dbf(};DriverID=277;DBQ=C:\ProjectDir', 'select * from Proj01'); <-- Proj01 need to be wildcard *.dbf
INSERT INTO Project01tmp
(FirstName, LastName, ....)
I'm having to specify the filename currently. How do I wildcard it correctly to import ANY dbf file instead of only Proj01.dbf? The client has no problem only putting one file at a time in the directory, it's just that the names will vary all the time.
So, is there a way to make it work as *.dbf?
Thanks.
December 19, 2005 at 8:00 am
This was removed by the editor as SPAM
December 20, 2005 at 4:51 am
I have already posted a reply but as often happens with this forum it just dissapeared
So here goes again...
I had a similar situation but needed control of what was happening and when. I needed to know what file was processed and from where it came etc. The system I had accounted for vast sums from counting machines, so if this may be overkill.
I also needed tp process many files from many sources and controlled everything from the vb application.
Steps:
Note that when calling the stord precedure I would execute the script withy a varchar parameter that passed the file name (Archived name above). That filename was inserted into the header for the imported data so that a full audit trail could be followed.
This procedure managed thousands of files a day.
Hope that helps
December 20, 2005 at 6:04 pm
Isn't there a tsql option to make this possible though? This is a totally server side run setup. No VB programming, only sp's and DTS, etc.
Or is it impossible with just sql code on ms sql server 2000 to handle variable filenames?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply