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。

  • 相关阅读:
    PHP 布尔类型
    php连接到数据库
    php_2
    php_1
    iOS开发之APP导入添加自定义字体
    iOS开发之判断横竖屏
    iOS开发之iPhone手机屏幕尺寸整理
    iOS开发之关闭暗黑模式
    iOS开发之iOS13推送deviceToken处理
    iOS开发之UIView和CALayer的区别
  • 原文地址:https://www.cnblogs.com/kerrycode/p/5117650.html
Copyright © 2011-2022 走看看