You are employed as a database administrator at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. You are employed at the regional Marketing offices of Domain.com. Your duties at Domain.com encompass the importing and exporting data in the SQL Server 2005 databases. You have received instruction from the CIO to send a text file to the main office asks that contains the updated contact data for the clients in your area.
The CIO requests that the data be sorted by the State, LastName, and FirstName columns. A Domain.com employee named Mia Hamm works in the Sales department. You instruct Mia Hamm to forward the necessary information to the database administrator at the main office. Mia Hamm needs to accomplish this by using the minimum of effort.
What should she do?
A.
A format file needs to be created for the export operation.
B.
Mia Hamm needs to identify State, LastName as well as FirstName in the ORDER BY clause in the bcp queryout command.
C.
The data needs to be copied into a new table that has a clustered index on State, LastName and FirstName. Thereafter the data can be exported.
D.
Mia Hamm needs to identify State, LastName as well as FirstName in the ORDER hint in the bcp out command.
Explanation:
The bcp utility bulk copies data between an instance of Microsoft SQL Server 2005 and a data file in a user-specified format. The bcp utility can be used to import large numbers of new rows into SQL Server tables or to export data out of tables into data files. Except when used with the queryout option, the utility requires no knowledge of Transact-SQL.
Queryout copies from a query and must be specified only when bulk copying data from a query.
Syntax:
bcp
{[[database_name.][owner].]{table_name | view_name} | "query"} {in | out | queryout | format} data_file
[-mmax_errors] [-fformat_file] [-x] [-eerr_file]
[-Ffirst_row] [-Llast_row] [-bbatch_size]
[-n] [-c] [-N] [-w] [-V (60 | 65 | 70 | 80)] [-6]
[-q] [-C { ACP | OEM | RAW | code_page } ] [-tfield_term] [-rrow_term] [-iinput_file] [-ooutput_file] [-apacket_size] [-Sserver_name[instance_name]] [-Ulogin_id] [-Ppassword] [-T] [-v] [-R] [-k] [-E] [-h"hint [,…n]"]