kgittinger
asked on
How to add a wildcard to a bulk insert command?
How to add a wildcard to a bulk insert command? I am useing Bulkinsert to brgin in data. Data is always in the same directry with the same prefix (extr_claim), the suffix changes by adding a date (such as_03292011) to the end, then the .txt extension. There will always be just 1 fine in the directry with the prefix. How and I add something like FROM ' mypath \extr_claim*.txt' to my script?
SELECT * FROM filenames WHERE fn_name LIKE 'mypath\extr_claim%.txt'
ASKER
How do I add that to the following?
BULK INSERT #tmp_Harvard_Feed
FROM 'mypath\extr_claim.txt'
WITH
(
ROWTERMINATOR = '\n'
)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If xp_cmdshell is disabled, you can enable it using -
exec sp_configure 'advanced' , 1
reconfigure with override
exec sp_configure 'xp_cmdshell' , 1
reconfigure with override
exec sp_configure 'advanced' , 0
reconfigure with override