I had a SQL coding question and wondered if anyone can help.
We have hundreds of csv files in a folder with names like “CP1.txt”, “CP2.txt”, “CP3.txt” etc.
The files represent code tables and each contains just two “|” separated columns like:
1|Person
2|Marked for deletion
3|Use instead
I wanted to import these into a SQL table with the following structure:
Code Table, (this would contain values like CP1, CP2, CP3 representing the csv filenames the codes came from)
Code (this would contain values from the first column of the csv file)
Description (this would contain values from the second column of the csv file)
Would anyone know how to do this using a stored Procedure?
Any help would be appreciated. Thanks.
Regards
TK
We have hundreds of csv files in a folder with names like “CP1.txt”, “CP2.txt”, “CP3.txt” etc.
The files represent code tables and each contains just two “|” separated columns like:
1|Person
2|Marked for deletion
3|Use instead
I wanted to import these into a SQL table with the following structure:
Code Table, (this would contain values like CP1, CP2, CP3 representing the csv filenames the codes came from)
Code (this would contain values from the first column of the csv file)
Description (this would contain values from the second column of the csv file)
Would anyone know how to do this using a stored Procedure?
Any help would be appreciated. Thanks.
Regards
TK