You work as the database administrator at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. All servers on the Domain.com network run Windows Server 2003 and all client computers run Windows XP Professional. The Domain.com network contains a SQL Server 2005 database server named Certkiller -DB01 that hosts a database named CK_Data.
You install a new SQL Server 2005 database server named Certkiller -DB02. You create a new database named CK_Sales on Certkiller -DB02. You must populate the CK_Sales database with data from several tables in the CK_Data database. You want to use the bcp command line utility to export the data to a text file. You want to accomplish this task as quickly as possible.
What should you do?
A.
Run the bcp command against each table that contains the required data.
B.
Run the bcp command against each column that contains the required data.
C.
Create a view based on the table columns that contain the required data and run the bcp command against resulting view.
D.
Run a query to return the required data and run the bcp command against the query’s return set.
Explanation:
The bcp command can be run against a table, a view, or a query.
Running the
bcp utility against the result set of a query will require the least amount of time.
Incorrect Answers:
A: You can run the bcp command against a table but you would need to run it against each table that contains the required data. You should first create a query that returns the required data and run the bcp command against the result set from the query.
B: The bcp command can be run against a table, a view, or a query. It cannot be run against a column.
C: You can run the bcp command against a table view but it would require less time to first create a query that returns the required data and run the bcp command against the result set from the query.
Reference:
Microsoft SQL Server 2005 Books Online (2006), Index: bcp utility [SQL Server], about bcp utility