Or, in another form, How to achieve the same type of thing that Load Into Table ... (ColA,ColB,filler(),ColC) would do and still fire triggers. Say you have a table:
You have a CSV file import.csv:
I have tried using the input, but cannot figure a way for it to skip a column. I have tried using the load table, with filler(), and this correctly skips the column, but does not fire the triggers. Moving the data into a temporary table and adjusting it from there is probably the way we will go, but I wanted to make sure I was not missing anything. Any help would be appreciated. |
Try using OPENSTRING. For your example, use something like:
See the FROM clause in the docs for more info. Worked great. Thanks Mark. I did have to add an "As Imported" alias at the end, otherwise it gave me an error at end of line, but that does exactly what I need.
(20 Apr '11, 14:58)
Siger Matt
Replies hidden
Glad to hear it worked for you, and reporting the error - I've corrected the statement.
(20 Apr '11, 15:11)
Mark Culp
|
Mark's suggestion for using OPENSTRING is probably the way to go, but if you want an alternate suggestion, you could also consider using a proxy table. Assuming you are on Windows, the Microsoft Access Text Driver is a decent ODBC driver for accessing CSV files. You could then map a proxy table to your CSV file and use it like any other base table. For some additional information/discussion have a look here Thanks Karim, I will give that a try next time.
(20 Apr '11, 14:58)
Siger Matt
|