同时更新两张表的信息 sqlserver
时间:2011-11-15
来源:互联网
where holdno='h20110008' and whseid='wh1'
update inventory set
inventory.status='HOLD'
where invHold.lot=inventory.lot
and invHold.loc=inventory.loc
and invHold.lpn=inventory.lpn
但是报错
消息 4104,级别 16,状态 1,第 3 行
无法绑定由多个部分组成的标识符 "invHold.lot"。
消息 4104,级别 16,状态 1,第 3 行
无法绑定由多个部分组成的标识符 "invHold.loc"。
消息 4104,级别 16,状态 1,第 3 行
无法绑定由多个部分组成的标识符 "invHold.lpn"。
作者: damoyoushui 发布时间: 2011-11-15
update inventory set
inventory.status='HOLD'
where invHold.lot=inventory.lot
and invHold.loc=inventory.loc
and invHold.lpn=inventory.lpn
大概你是这个意思:
update inventory set
inventory.status='HOLD'
from inventory,invHold
where invHold.lot=inventory.lot
and invHold.loc=inventory.loc
and invHold.lpn=inventory.lpn
作者: perfectaction 发布时间: 2011-11-15
没有这语法
update inventory set
inventory.status='HOLD'
where invHold.lot=inventory.lot
and invHold.loc=inventory.loc
and invHold.lpn=inventory.lpn
大概你是这个意思:
update inventory set
inventory.s……

作者: jwdream2008 发布时间: 2011-11-15
update invHold set invHold.status ='1'
where holdno='h20110008' and whseid='wh1'
update inventory set
status='HOLD'
from inventory , invHold
where invHold.lot=inventory.lot
and invHold.loc=inventory.loc
and invHold.lpn=inventory.lpn
你可将两句话写在存储过程中,然后去调用存储过程.
create procedure my_proc
as
begin
update invHold set invHold.status ='1'
where holdno='h20110008' and whseid='wh1'
update inventory set
status='HOLD'
from inventory , invHold
where invHold.lot=inventory.lot
and invHold.loc=inventory.loc
and invHold.lpn=inventory.lpn
end
作者: dawugui 发布时间: 2011-11-15
begin tran
update...
update...
commit
作者: qianjin036a 发布时间: 2011-11-15
set invHold.status ='1'
FROM inventory
where holdno='h20110008' and whseid='wh1'
update inventory
set
inventory.status='HOLD'
FROM invHold
where invHold.lot=inventory.lot
and invHold.loc=inventory.loc
and invHold.lpn=inventory.lpn
--少了from
作者: roy_88 发布时间: 2011-11-15
update a set inventory.status='HOLD' from inventory a ,invHold b where a.lot=b.lot and a.loc=b.loc and a.lpn=b.lpn
作者: fredrickhu 发布时间: 2011-11-15
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28