zoukankan      html  css  js  c++  java
  • SQL SERVER使用ODBC 驱动建立的链接服务器调用存储过程时参数不能为NULL值

        我们知道SQL SERVER建立链接服务器(Linked Server)可以选择的驱动程序非常多,最近发现使用ODBC 的 Microsoft OLE DB 驱动程序建立的链接服务器(Linked Server), 调用存储过程过程时,参数不能为NULL值。

    clipboard

    否则就会报下面错误提示:

    对应的英文错误提示为:

    EXEC xxx.xxx.dbo.Usp_Test NULL,NULL,'ALL'

    Msg 7213, Level 16, State 1, Line 1

    The attempt by the provider to pass remote stored procedure parameters to remote server 'xxx'  failed. Verify that the number of parameters, the order, and the values passed are correct.

    对应的中文错误提示为:

    EXEC xxx.xxx.dbo.Usp_Test NULL,NULL,'ALL'

    Msg 7213, Level 16, State 1, Line 1

    提供程序将远程存储过程参数传递给远程服务器 'xxx' 的尝试失败。请确保参数的数目、顺序和所传递的值正确。

     

    EXEC xxx.xxx.dbo.Usp_Test '','','ALL' 或者给参数赋予一个合适的值则不会报任何错误。另外使用Microsoft OLE DB Provider for SQL Server驱动方式建立的链接服务器(Linked Server)调用存储过程时参数就可以为NULL。

  • 相关阅读:
    opentsdb安装部署
    python发送邮件(html)例子
    python查库写库例子
    获取rds的cpu和内存使用情况
    数据库损坏的情况下如何获取到dbid
    grafana安装升级部署
    Specified key was too long
    mysql动态执行sql批量删除数据
    kafka删除topics
    cratedb导入json文件
  • 原文地址:https://www.cnblogs.com/kerrycode/p/5117650.html
Copyright © 2011-2022 走看看