[thelist] sql: read in data and execute a query

Brian Cummiskey brian at hondaswap.com
Thu Jul 12 18:27:21 CDT 2007


Judah McAuley wrote:
> What I don't know is how to DTS to read the csv file in, stuff the 
> contents in a varible and then put the variable into the query, then 
> execute the query.

I'd recommend importing the CSV to a temp table, then doing an update join:


update table
set X  = t.field
from temptable t
join table d on d.id = t.id



More information about the thelist mailing list