奥礼网
新记
SQL SERVER 中怎么把表中的数据赋值给存储过程的变量?
如题所述
举报该文章
相关建议 推荐于2017-12-16
declare @id int
select @id = user_id from users where name = '张三' -- 从users表读取张三的user_id,并赋值给变量@id
execute upYourProc @id --将变量传递给存储过程。
温馨提示:内容为网友见解,仅供参考
当前网址:
https://aolonic.com/aa/k1k3ga1aw.html
其他看法
第1个回答 2011-09-26
declare @id int;
select @id = user_id from users where name = '张三';
execute upYourProc @id --将变量传递给存储过程;
相似回答
大家正在搜
相关问题
SQL SERVER 中把表名作为参数传递给存储过程后,怎么...
sql server 怎样对查询出来的数据循环赋值给变量,执...
在sql server中如何将获取日期和时间值赋值给一个变量
sql server中exec(赋给sql语句的变量)如何用...
SQL存储过程中怎样给变量赋值?
Sql server 存储过程中怎么将变量赋值?
如何将SQL查询出来的一列数据赋值,执行存储过程
在存储过程中怎么表的全部数据赋值给变量