Import and Export Data: Lab Diagram
Import and Export Data: Lab Diagram
Introduction
Data Import and Export
Summary
Introduction
The Import and Export Data module provides you with the instruction and server
hardware to develop your hands on skills in the defined topics. This module includes the
following exercises:
Lab Diagram
During your session you will have access to the following lab configuration. Depending
on the exercises you may or may not use all of the devices, but they are shown here in the
layout to get an overall understanding of the topology of the lab.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 1/20
7/23/2019 Print content
In this module you will be working on the following equipment to carry out the steps
defined in each exercise.
To start, simply choose a device and click Power on. In some cases, the devices may
power on automatically.
For further information and technical support, please see our Help and Support
page.
Copyright Notice
This document and its content is copyright of Practice-IT - © Practice-IT 2014. All rights reserved. Any
redistribution or reproduction of part or all of the contents in any form is prohibited other than the
following:
1) You may print or download to a local hard disk extracts for your personal and non-commercial use
only.
2) You may copy the content to individual third parties for their personal use, but only if you
acknowledge the website as the source of the material. You may not, except with our express written
permission, distribute or commercially exploit the content. Nor may you transmit it or store it in any
other website or other form of electronic retrieval system.
In this exercise, you will learn the following about Microsoft SQL Server 2012:
Transferring data
Performing bulk copy
Performing bulk insert
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 2/20
7/23/2019 Print content
Transferring Data
The Import and Export Wizard, or DTAWizard.exe, is a component that belongs to SQL
Server Integration Services. When you use the Import and Export Wizard, you can
import or export data from the following sources:
Step 1
Ensure you have powered on the required devices and Connect to PLABSQL01.
Click Start, select All Programs, select Microsoft SQL Server 2012, and then select
Import and Export Data (64-bit).
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 3/20
7/23/2019 Print content
Click the Database drop-down list, select AdventureWorks2012, and click Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 4/20
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 5/20
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 6/20
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 7/20
7/23/2019 Print content
On the Specify Table copy or Query screen, keep the default selection of Copy data
from one or more tables or views and click Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 8/20
7/23/2019 Print content
On the Select Source Tables and Views screen, select the checkbox before Source:
(local) and click Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 9/20
7/23/2019 Print content
On the Save and Run Package screen, Run immediately is selected by default. Click
Next.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 10/20
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 11/20
7/23/2019 Print content
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 12/20
7/23/2019 Print content
Note that export and import operation may take some time.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 13/20
7/23/2019 Print content
In SQL Server, the bcp utility can be used to perform bulk import or export data. You can
import data from a file or export data to a file from the database. If you have installed the
SQL Server Native Client feature, then you can use the bcp utility with the XML format
files. The bcputilty is run along with the SQL query to achieve the output.
Step 1
From PLABSQL01 open SQL Server Management Studio.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 14/20
7/23/2019 Print content
To copy a specific column into a data file, run the following command in a new query
window:
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 15/20
7/23/2019 Print content
To copy a specific row into a data file, run the following command in a new query
window:
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 16/20
7/23/2019 Print content
To create an XML file, run the following command in a new query window:
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 17/20
7/23/2019 Print content
You can use the BULK INSERT statement and then load data into a table. The BULK
INSERT statement imports the data from a file and then adds the data into the table.
Step 1
From Microsoft SQL Server Management Studio in Object Explorer, expand
Databases, right-click AdventureWorks2012,andselect New Query.
You can perform different operations using the BULK INSERT command.
To import data from a file, run the following command in a new query window:
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 18/20
7/23/2019 Print content
Close the query window without saving and collapse the AdventureWorks2012 node in
Object Explorer.
Shutdown all virtual machines used in this lab, by using the power functions located in
the Tools bar before proceeding to the next module. Alternatively you can log out of the
lab platform.
Summary
In this exercise, you learnt the following about Microsoft SQL Server 2012:
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 19/20
7/23/2019 Print content
Transferring data
Performing bulk copy
Performing bulk insert
Also try
Using the current lab setup, you can perform the following tasks at your own pace.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 20/20