zoukankan      html  css  js  c++  java
  • BCP导入导出MsSql

    1、导出数据

    (1)、在Sql Server Management Studio中:

    --导出数据到tset1.txt,并指定本地数据库的用户名和密码
    --这里需要指定数据库完全限定名。
    --username 数据登录名
    --password 数据库密码
    EXEC master..xp_cmdshell 'BCP "SELECT * FROM Testdb.dbo.TestVoucher" queryout d:	set1.txt -c -U"username" -P"password"'

    注:SQL Server阻止了对组件xp_cmdshell过程的解决方案

    sp_configure 'show advanced options',1
    reconfigure
    go
    sp_configure 'xp_cmdshell',1
    reconfigure
    go

    (2)、在CMD中

    BCP "SELECT * FROM Testdb.dbo.TestVoucher" queryout d:	set1.txt -c -S"服务器地址" -U"username" -P"password"

    如图:

    2、导入数据

    (1)、在Sql Server Management Studio中:

     EXEC master..xp_cmdshell 'bcp Testdb.dbo.TestVoucher  in d:	set1.txt -c -T' 

    (2)、在CMD中

    bcp Testdb.dbo.TestVoucher  in d:	set1.txt -c -T

    图:

  • 相关阅读:
    DOM节点类型
    javascript中的变量、作用域
    this 不同情况指代的对象
    BOM对象节点
    浏览器兼容性
    总结
    javascript事件流讲解和实例应用
    7.20
    7.16总结
    飞机大战
  • 原文地址:https://www.cnblogs.com/xdpxyxy/p/3199726.html
Copyright © 2011-2022 走看看