VB and VBA Users Source Code: Importing/exporting data using BCP
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Importing/exporting data using BCP
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Friday, January 11, 2002
Hits:
1276
Category:
Database/SQL/ADO
Article:
The Bulk Copy Program (BCP) is designed to facilitate the import and export of data from your tables to ASCII files. As its name implies, it batches the loading and extraction process. BCP is a command-line program and supports two states, in and out: Example BCP (export): bcp pubs..authors out c:\authors.txt -c -U MyUserName -P MyPassword -S MyServerName Example BCP (import): bcp pubs..authors in c:\authors.txt -c -U MyUserName -P MyPassword -S MyServerName Where: -c = Operation performed using CHARACTER datatype for all fields (defaults to using Tabs deliminate fields). -U = User name -P = Password -S = Server name Other useful parameters are: -r = Row terminator -t = Field terminator
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder