Lab Answer Key: Module 6: Importing and Exporting Data

Sep 26, 2016 - select SQL. Server selected, that Use. Windows is selected; click the select Microsoft. Lab Answer Key: Module 6: Importing and Exporting Data.
3MB taille 56 téléchargements 376 vues
Lab Answer Key: Module 6: Importing and Exporting Data

1 of 10

Lab Answer

https://skillpipe.courseware-marketplace.com/reader/fr-FR/Book/Book...

Exporting Data

Lab: Importing Exercise

Wizard

Task 1: Prepare

1.

Ensure running,

are both ADVENTUREWORKS\Student

with the 2.

In the D:

Run as

administrator 3.

Click Yes

wait for the

script to

Task 2: Use

1.

Start SQL

database engine

using Windows 2.

In Object

database,

point to 3.

On the

Next.

4.

On the

select SQL

Server

selected, that Use

Windows

is selected;

and click 5.

On the

select Microsoft

26/09/2016 16:01

Lab Answer Key: Module 6: Importing and Exporting Data

2 of 10

Excel.

https://skillpipe.courseware-marketplace.com/reader/fr-FR/Book/Book...

Starter\Sales.xls,

ensure 6.

On the

specify the data to

transfer 7.

On the

sql script file

in the D:

Query page,

click Next 8.

On the

Destination

column 9.

On the

10. On the

click Next. selected, and

click Next 11.

On the

is

successful, 12. Start Excel

folder and view

the data

Result: After workbook named

an Excel

Exercise

Task 1: Create

1.

In SQL database

HumanResources table and

click Select 2.

View the

Unicode

26/09/2016 16:01

Lab Answer Key: Module 6: Importing and Exporting Data

3 of 10

https://skillpipe.courseware-marketplace.com/reader/fr-FR/Book/Book...

characters. 3.

Open a

format file:

bcp

MIA-SQL -T

-w \JobCandidateFmt.

4.

Start Notepad

\Labfiles\Lab06\Starter folder.

Then view

Task 2: Use

1.

2.

Use Notepad

\Labfiles

\Lab06

Notepad.

In the command

data the new

candidate bcp \Starter\JobCandidates.

database. \Labfiles\Lab06 \Labfiles\Lab06

\Starter\JobCandidateFmt.

3.

Close the

4.

In SQL rows from

Result: After JobCandidateFmt. HumanResources

top 1000 been imported.

into the

26/09/2016 16:01

Lab Answer Key: Module 6: Importing and Exporting Data

4 of 10

https://skillpipe.courseware-marketplace.com/reader/fr-FR/Book/Book...

Exercise

Task 1: Disable

1.

In SQL

InternetSales

database

Select Top

1000 Rows 2.

Expand

Note that the

table has 3.

Click New

Transact-SQL

code to ALTER DISABLE; GO

4.

Click Execute

Task 2: Use

1.

Use Excel

folder, and note

that it contains 2.

In SQL

code to disable

indexes BULK FROM WITH (

26/09/2016 16:01

Lab Answer Key: Module 6: Importing and Exporting Data

5 of 10

https://skillpipe.courseware-marketplace.com/reader/fr-FR/Book/Book...

);

3.

Click Execute

4.

Switch table, remove the SELECT

CurrencyRate modified number of rows

as you

Task 3: Rebuild

1.

In SQL

code to import

data, enter ALTER REBUILD; GO

2.

Click Execute

Result: After data into the

to load

Exercise

Task 1: Copy

1.

Use Notepad folder and

\Labfiles\Lab06\Starter have

supplied

26/09/2016 16:01

Lab Answer Key: Module 6: Importing and Exporting Data

6 of 10

2.

Copy the

https://skillpipe.courseware-marketplace.com/reader/fr-FR/Book/Book...

D:\Labfiles

\Lab06\Starter

Note: In this environment volume that

real workstation to a in a SAN

that would be

Task 2: Disable

1.

In SQL database

HumanResources 1000 Rows.

Note the 2.

Expand

folder and

its Indexes 3.

Click New

Transact-SQL

code to ALTER HumanResources. DISABLE; GO ALTER HumanResources. DISABLE; GO ALTER NOCHECK GO

4.

Click Execute

26/09/2016 16:01

Lab Answer Key: Module 6: Importing and Exporting Data

7 of 10

https://skillpipe.courseware-marketplace.com/reader/fr-FR/Book/Book...

Task 3: Use

1.

In SQL

code to disable

indexes INSERT SELECT FORMATFILE WHERE

2.

Click Execute

3.

Switch table and

JobCandidate for

candidates

Task 4: Re-Enable

1.

In SQL

code to import

data, enter ALTER HumanResources. REBUILD; GO ALTER HumanResources. REBUILD; GO ALTER CHECK GO

26/09/2016 16:01

Lab Answer Key: Module 6: Importing and Exporting Data

8 of 10

2.

https://skillpipe.courseware-marketplace.com/reader/fr-FR/Book/Book...

Click Execute

Result: After the dbo.JobCandidates

JobCandidates2.txt into

26/09/2016 16:01

Lab Answer Key: Module 6: Importing and Exporting Data

9 of 10

https://skillpipe.courseware-marketplace.com/reader/fr-FR/Book/Book...

26/09/2016 16:01

Lab Answer Key: Module 6: Importing and Exporting Data

10 of 10

https://skillpipe.courseware-marketplace.com/reader/fr-FR/Book/Book...

26/09/2016 16:01