Skip to content

Latest commit

 

History

History
74 lines (61 loc) · 3.31 KB

File metadata and controls

74 lines (61 loc) · 3.31 KB
title HumanResources.myTeam Sample Table (SQL Server) | Microsoft Docs
description To run code examples for importing and exporting bulk data in SQL Server, you need to create a test table named myTeam in the HumanResources schema.
ms.custom
ms.date 03/14/2017
ms.prod sql
ms.prod_service database-engine, sql-database, sql-data-warehouse, pdw
ms.reviewer
ms.technology data-movement
ms.topic conceptual
helpviewer_keywords
myTeam sample table [SQL Server]
bulk importing [SQL Server], examples
bulk exporting [SQL Server], examples
ms.assetid 27da45a0-c1f4-4bf4-ab24-6196e80d3834
author MashaMSFT
ms.author mathoma
monikerRange >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current

HumanResources.myTeam Sample Table (SQL Server)

[!INCLUDEappliesto-ss-asdb-asdw-pdw-md] Many of the code examples in Importing and Exporting Bulk Data require a special-purpose test table named myTeam. Before you can run the examples, you must create the myTeam table in the HumanResources schema of the [!INCLUDEssSampleDBobject] database.

Note

[!INCLUDEssSampleDBobject] is one of the sample databases in [!INCLUDEssCurrent].

The myTeam table contains the following columns.

Column Data type Nullability Description
EmployeeID smallint Not null Primary key for the rows. Employee ID of a member of my team.
Name nvarchar(50) Not null Name of a member of my team.
Title nvarchar(50) Nullable Title the employee performs on my team.
Background nvarchar(50) Not null Date and time the row was last updated. (Default)

To create HumanResources.myTeam

  • Use the following [!INCLUDEtsql] statements:

    --Create HumanResources.MyTeam:   
    USE AdventureWorks;  
    GO  
    CREATE TABLE HumanResources.myTeam   
    (EmployeeID smallint NOT NULL,  
    Name nvarchar(50) NOT NULL,  
    Title nvarchar(50) NULL,  
    Background nvarchar(50) NOT NULL DEFAULT ''  
    );  
    GO  

To populate HumanResources.myTeam

  • Execute following INSERT statements to populate the table with two rows:

    USE AdventureWorks;  
    GO  
    INSERT INTO HumanResources.myTeam(EmployeeID,Name,Title,Background)  
       VALUES(77,'Mia Doppleganger','Administrative Assistant','Microsoft Office');  
    GO  
    INSERT INTO HumanResources.myTeam(EmployeeID,Name,Title,Background)  
       VALUES(49,'Hirum Mollicat','I.T. Specialist','Report Writing and Data Mining');  
    GO  

    [!NOTE]
    These statements skip the fourth column, Background. This has a default value. Skipping this column causes this INSERT statement to leave this column blank.

See Also

Bulk Import and Export of Data (SQL Server)