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,删除后导入再重建
  • 相关阅读:
    占位博客
    占位博客
    占位博客
    占位
    占位
    占位
    占位
    占位
    python字典设置初始值setdefault()与get()
    自然语言处理如何入门
  • 原文地址:https://www.cnblogs.com/Ammy/p/1234650.html
Copyright © 2011-2022 走看看