初始值由SQL中的参数值替换 [英] Initialized value replaced by parameter value in SQL

查看:96
本文介绍了初始值由SQL中的参数值替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的存储过程如下:



Hi, I got a stored procedure written as below:

DECLARE
    @p_SiteId AS TINYINT = 0
   ,@p_FocusedFactoryList AS VARCHAR(MAX) = '';
   ,@p_ItemNumberInternal AS VARCHAR(50);
--AS
BEGIN





从上面的声明中,我得到@p_SiteId,这是init为0.如果从我的代码中,参数值例如,3是否在整个存储过程中将0替换为3?



From the above declaration, I got @p_SiteId which is init to 0. If from my codes, the parameter value is 3 for example, would the 0 be replaced by 3 inside the entire stored procedure?

推荐答案

你好,

在你SP中,你设置默认值@p_SiteId = 0表示,如果不传递参数值,则默认设置为0。此外,当你执行SP时,不需要传递该变量。



如需参考,请检查:

指定参数默认值



谢谢
Hello ,
In you SP , you have set default value of @p_SiteId =0 means , if you will not pass the parameter value then it will be set to 0 by default . Moreover when you execute the SP then no need to pass that variable .

For reference check this :
Specifying a Parameter Default Value

thanks


这篇关于初始值由SQL中的参数值替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆