【问题标题】:BCP queryout from Azure VM : SQLState = 37000, NativeError = 40515 Reference to database and/or server name in 'DBName.dbo.TableName' is not supportedAzure VM 的 BCP 查询:SQLState = 37000,NativeError = 40515 不支持对“DBName.dbo.TableName”中的数据库和/或服务器名称的引用
【发布时间】:2019-02-18 04:17:01
【问题描述】:

我试图在本地计算机的 SSMS 中使用 BCP 将 Azure VM 中的数据库中的表导出到文本文件中。

!! bcp "SELECT * FROM DBName.dbo.TableName" queryout D:\tablename.txt  
   -S AzureVM -U userName -P passWord -n

但结果是以下错误

Starting copy...
SQLState = 37000, NativeError = 40515
Error = [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Reference to database and/or server name in 'DBName.dbo.TableName' is not supported in this version of SQL Server.
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC Driver 13 for SQL Server]Unable to resolve column level collations

BCP copy out failed

我尝试使用内部服务器而不是 Azure VM 运行类似的 bcp 命令。命令执行成功。

找到了解决方案。我发布了解决方案,因为它可能会帮助遇到同样问题的人。

【问题讨论】:

    标签: azure ssms bcp


    【解决方案1】:

    bcp 命令已修改为包含-d 标志并指定数据库名称。

    !! bcp "SELECT * FROM dbo.TableName" queryout D:\account.txt -d DBName  
       -S AzureVM -U userName -P passWord -n
    

    【讨论】:

      猜你喜欢
      • 2017-12-30
      • 2010-09-21
      • 2022-01-12
      • 2020-03-13
      • 2020-02-07
      • 2014-04-17
      • 2021-04-11
      • 2017-05-23
      • 2014-07-19
      相关资源
      最近更新 更多