O'Reilly logo

Microsoft® SQL Server™ 2000 DBA Survival Guide, Second Edition by Mark Spenik, Orryn Sledge

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sample BCP Scripts

This section describes how to use BCP to perform typical import and export routines. The examples discussed in this section use the pubs..discounts table.

The following is the structure of the discounts table:

discounttype varchar (40) 
stor_id varchar
lowqty smallint
highqty smallint
discount decimal(4, 2)

The following is discounts table data:

discounttype                             stor_id lowqty highqty discount 
---------------------------------------- ------- ------ ------- --------
Initial Customer                         (null)  (null) (null)  10.50
Volume Discount                          (null)  100    1000    6.70
Customer Discount                        8042    (null) (null)  5.00
					

Simple Import

This example uses the -c switch to load a data file that contains tab-delimited fields and newline-delimited rows. For this example, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required