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。

  • 相关阅读:
    第一次作业
    第五次作业
    第三次作业
    第六次作业
    第二次作业
    scikitlearn学习 决策树
    [阅读]Think Python CH3 Functions
    [阅读]Think Python CH2 Variables, Expressions, and Statements
    [阅读]Think Python CH1 The Way of the Program
    Hive操作符和函数
  • 原文地址:https://www.cnblogs.com/kerrycode/p/5117650.html
Copyright © 2011-2022 走看看