zoukankan      html  css  js  c++  java
  • sql server的bcp指令

    有时需要允许bcp指令

    -- 允许配置高级选项
    EXEC sp_configure 'show advanced options', 1
    GO
    -- 重新配置
    RECONFIGURE
    GO
    -- 启用xp_cmdshell
    EXEC sp_configure 'xp_cmdshell', 1
    GO
    --重新配置
    RECONFIGURE
    GO

    1、导出文件:

      EXEC ('EXEC master..xp_cmdshell ''bcp "select * from [dbname].[dbo].tablename where xx=''''xx'''' " 

    queryout "D:sql.txt" -c -S"QCLOUD-VM" -U"username" -P"pwd"''')

    2、导入文件:

      exec master..xp_cmdshell 'bcp [dbname].[dbo].tablename in d:sqlsql.txt -c -T'

  • 相关阅读:
    连通块问题
    线性数据结构
    NOIP2018总结
    原码反码补码详解
    一些常用的算法技巧总结
    骗分导论
    模板
    模板
    AcWing
    AcWing
  • 原文地址:https://www.cnblogs.com/zhaoyihao/p/6294136.html
Copyright © 2011-2022 走看看