So it seems you are trying to automatically look into the PRODUCTION folder and BULK INSERT the latest "today's" files?
I think you are looking for something like this....
-- load up all the files in your PRODUCTION folder into a variable
DECLARE @BackupDirectory SYSNAME = 'C:\PRODUCTION\\' -- remove the extra slash from the path! This is so the StockOverflow color formatting works properly on the page.
DECLARE @allFiles AS TABLE(fName varchar(500), d INT, f INT)
DECLARE @fileToImport AS VARCHAR(500)
INSERT INTO @allFiles
EXEC master.sys.xp_DirTree @BackupDirectory, 10, 1
-- get today's file suffix i.e.: {01052014} or whatever the date is today
DECLARE @dateSuffix AS CHAR(8)
SET @dateSuffix = CAST(RIGHT(CONCAT('00', DATEPART(dd, getdate())), 2) AS CHAR(2))
+ CAST(RIGHT(CONCAT('00', DATEPART(mm, getdate())), 2) AS CHAR(2))
+ CAST(DATEPART(yy, getdate()) AS CHAR(4))
SELECT @dateSuffix
DECLARE @i AS INT
SET @i = 1
-- loop through the files one by one and execute the bulk insert.
WHILE @i <= (SELECT COUNT(*) FROM @allFiles WHERE fName LIKE '%'+@dateSuffix)
BEGIN
SELECT TOP 1 @fileToImport = fName FROM @allFiles WHERE fName LIKE '%'+@dateSuffix+'%' ORDER BY fName -- filter on the today's files only
BULK INSERT [myDb].[mySchema].[myTable]
FROM 'C:\PRODUCTION\\' + @fileToImport + '' -- remove the extra slash from the path! This is so the StockOverflow color formatting works properly on the page.
WITH (FIELDTERMINATOR ='|',ROWTERMINATOR = '\n')
DELETE FROM @allFiles WHERE fName = @fileToImport -- remove processed file from the table variable
SET @i = @i + 1
END
Note: I did not have time to test this and I think you may need to use a cursor instead of my WHILE loop but in theory this should give you some idea.