zoukankan      html  css  js  c++  java
  • Procedure or function 'pu_usr_User' expects parameter '@WhiteIp', which was not supplied.

    遇到这个问题,是因为存储过程的参数,设置默认值写错了。

    错误写法

      @WhiteIp NVARCHAR(MAX) NULL,

    Stored procedure with default parameters

    I wrote with parameters that are predefined

    They are not "predefined" logically, somewhere inside your code. But as arguments of SP they have no default values and are required. To avoid passing those params explicitly you have to define default values in SP definition:

    Alter Procedure [Test]
        @StartDate AS varchar(6) = NULL, 
        @EndDate AS varchar(6) = NULL
    AS
    ...

    NULLs or empty strings or something more sensible - up to you. It does not matter since you are overwriting values of those arguments in the first lines of SP.

    Now you can call it without passing any arguments e.g. exec dbo.TEST

    修正之后的写法

     @WhiteIp NVARCHAR(MAX) = NULL,

  • 相关阅读:
    1211.分割平衡字符串
    1282.用户分组
    分模块配置
    Spring Bean相关配置
    Spring IOC是什么
    Spring简介
    小黄衫感想
    团队展示
    原型设计
    结对作业
  • 原文地址:https://www.cnblogs.com/chucklu/p/10824269.html
Copyright © 2011-2022 走看看