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,删除后导入再重建
  • 相关阅读:
    博雅机器学习十讲1
    tensorflow学习笔记1
    卓有成效的程序员3
    卓有成效的程序员2
    卓有成效的程序员1
    探索需求6
    数据预处理
    数据科学介绍
    探索需求5
    探索需求4
  • 原文地址:https://www.cnblogs.com/Ammy/p/1234650.html
Copyright © 2011-2022 走看看