9.1. Use the Bulk Copy Program Utility

The Bulk Copy Program (BCP) utility is run from the command line, and a version of it is available in many editions of SQL Server. However, there have been enhancements in SQL Server 2008. Any DBA that has used BCP will tell you that it is a valuable and flexible tool. Using it, you can easily import and export large amounts of data. A simple example of the syntax follows:

bcp {dbtable | query}
{in | out | queryout | format} datafile
[-n native type] [-c character type]
[-S server name] [-U username]
[-P password] [-T trusted connection]

The vertical | symbol inside the curly braces means that you can use only one of the choices listed inside the braces. All of the switches listed in the preceding syntax ...

Get SQL Server® 2008 Administration: Instant Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.