I am working with a number of Flat Files that will be processed daily. The FileName is a combination of text and numbers. The numbers are the
date of transaction. Therefore, I need to pick up the numbers and use it as a Date (DateAdded) inserted into the database. However, the positioning of the numbers is not fixed.
Examples of what the File Names:
Dial20100610.txt and Dialog20100611.txt
Now, I have inserted all the data into a staging table called Raw_Staging with File Name as the name of the column (eg. Dial20100610.txt, Dialog20100612.txt)
Is there a way to strip the text character from the columns with tsql so I am only left with the numbers and then convert it to a Datetime
datatype so I can insert it into the destination table?
View Complete Post