Import text files script

By Nigel Rivett on 19 October 2003 | Tags: Import/Export


Nigel submitted "This procedure will import all text files that are placed in a directory into a table. The files are then moved to an archived table.

If the SP call is scheduled then it will import any files that arrive.
Used togther with the ftp procedure it can be used to import files from an ftp server.

The process imports into a global temp table then calls another SP to move the data to the destination table. The called SP is expected to be written for the file types to be imported.
The import SP deals with crlf delimitted files only but is easy to change for others.

For large amounts of data you may want to import directly to the destination table - this just means changing the bulk insert statement and removing the global temp table."

Link: Import text files script


Related Articles

Use SqlBulkCopy to Quickly Load Data from your Client to SQL Server (4 May 2007)

Using Fuzzy Lookup Transformations in SQL Server Integration Services (22 January 2007)

Exporting records into ASCII format (13 August 2000)

Uploading MDB to SQL Server Programmatically (9 August 2000)

Running Jobs (UNC vs Drive Letters ) (2 July 2000)

Other Recent Forum Posts

. How to Save Big on Temu with Coupon Code [act892435] in the USA (55m)

Limited-Time USA Offer: Temu Coupon Code {act892435} for Great Savings (60m)

Temu coupon code $100{act892435}off for USA customers (64m)

Temu Canada Black Friday Sale: 90% Off {acs540599} with Free Shipping 2024 (71m)

Temu Coupon Code $100 off [acr639380] Get 30% Off On Your First Order (113m)

Temu Coupon Code Romania [acr639380] 100€ Reducere (115m)

Temu Kod Za Popust [acr639380] 40% Popusta Za Postojeće Kupce (117m)

Temu Coupon Code 2024 for Existing Customers (acr639380) (2h)

- Advertisement -