zoukankan      html  css  js  c++  java
  • BCP

    SQL Server BCP 的数据导入导出 
     
    导入文本文件 
    EXEC master..xp_cmdshell 'bcp dbname..tablename in c:\DT.txt -c -Sservername -Usa -Ppassword' 

    导出文本文件 
    EXEC master..xp_cmdshell 'bcp dbname..tablename out c:\DT.txt -c -Sservername -Usa -Ppassword'
    或 
    EXEC master..xp_cmdshell 'bcp "Select * from dbname..tablename" queryout c:\DT.txt -c -Sservername -Usa -Ppassword' 
     
    cmd

    C:\Documents and Settings\Amy.Qiu>bcp gbldb.dbo.master in \\192.168.60.252\ReadW
    riteShare\GBLDB_Master\GBLDB_Master.txt -192.168.60.252\SQL2005 --n


    SQLState = 37000, NativeError = 1934
    Error = [Microsoft][SQL Native Client][SQL Server]INSERT failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SEToptions are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.

    原因是,某个VIEW的UNIQUE CLUSTERED,删除后导入再重建
  • 相关阅读:
    Oracle的序列、视图、索引和表空间
    MySQL存储过程
    MySQL触发器
    MySQL索引和视图
    完整性约束
    Mybatis的核心对象及运行流程
    Mybatis中配置连接池
    IDEA中创建Maven工程整合Mybatis
    Idea中创建JavaWeb工程
    实现整数集合的并、交、差运算
  • 原文地址:https://www.cnblogs.com/Ammy/p/1234650.html
Copyright © 2011-2022 走看看