jeffwest21
IS-IT--Management
I have 4 files that are dumped automatically off a sftp site, three of the files have specific file names that do not change, however the 4th one does change as it is prefixed with the date of creation i.e. FileName-exp-2013-09-24.csv.
My bulk insert statement reads thus
How do I add a wild card to the end of the file path between the exp-Date and .csv so that it reads this into the right table.
All the files are CSV format which is why I cannot just do *.csv, the files are autogenerated everyday and need to be dated stamped for later chacking if required so I cannot get the file named differently.
'Clever boy...'
My bulk insert statement reads thus
Code:
BULK INSERT CDR FROM '\\DirPath\FileName-exp-2013-09-24.csv'
WITH (
DATAFILETYPE = 'char',
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
How do I add a wild card to the end of the file path between the exp-Date and .csv so that it reads this into the right table.
All the files are CSV format which is why I cannot just do *.csv, the files are autogenerated everyday and need to be dated stamped for later chacking if required so I cannot get the file named differently.
'Clever boy...'