bcp导入到数据库_Bcp和链接到Azure的服务器

bcp导入到数据库

介绍 ( Introduction )

Sometimes, we need to use the command line to copy tables using the command line. In this new chapter, we will use the BCP command to copy tables from a local machine to the SQL Server in Azure. The BCP is a very fast bulk copy tools used for this purpose.

有时,我们需要使用命令行来使用命令行复制表。 在这一新的章节中,我们将使用BCP命令将表从本地计算机复制到Azure中SQL Server。 BCP是用于此目的的非常快速的批量复制工具。

We will also learn how to create a Linked Server in our local machine to Azure. The Linked Servers are very powerful features of SQL Server to connect SQL Server to different Data Sources like Excel, MS Access, Oracle, MySQL, and several databases. In this example, we will connect to SQL Azure.

我们还将学习如何在本地计算机上创建到Azure的链接服务器。 链接服务器是SQL Server的非常强大的功能,可以将SQL Server连接到不同的数据源,例如Excel,MS Access,Oracle,MySQL和多个数据库。 在此示例中,我们将连接到SQL Azure。

要求 ( Requirements )

入门 ( Getting started )

  1. In order to start, in the local machine open the command prompt.

    为了启动,在本地计算机上打开命令提示符。


    Figure 1. The cmd


    图1. cmd

  2. In the command prompt, run the following bcp command:

    在命令提示符下,运行以下bcp命令:

    bcp adventureworks2014.humanresources.department out c:\s
    cripts\department.dat -S localhost -T -n –q

    bcp adventureworks2014.humanresources.department out c:\ s
    cripts \ department.dat -S本地主机-T -n –q

  3. The command copies the data of the table HumanResources.Department of the Adventureworks2014 database to the file department.dat. The –S parameter is the Server name, the –T me
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值