I've just done this for mySql - I presume by SQL you mean SQL Server.
Should be possible to use the same technique.

Create a temporary table
Do a bulk insert from the csv file into this table (need to make sure csv files stick to a rigid syntax)
Use INSERT ... SELECT to transfer data into required table
Delete temporary table

You need to be careful to Lock to avoid data corruption, and deal with the possiblity of
failure - mySql doesn't rollback tables that have been created so you need to make
sure that on a failure the temprary table is deleted etc.

Rafe Fitzpatrick
Web Manager

http://www.alienationdesign.co.uk
mailto:[EMAIL PROTECTED]
Tel: 0141 575 9700
Fax: 0141 575 9600

Creative solutions in a technical world

----------------------------------------------------------------------
Get your domain names online from:
http://www.alienationdomains.co.uk
Reseller options available!
----------------------------------------------------------------------
----------------------------------------------------------------------

Reply via email to