declare @j nvarchar(4000)
set @j='begin
update #temp1
set
ff=#temp5.ff,
F_103='+@temp3yxbiao+',
一级审批人='+@temp3shrbiao+',
二级审批人邮箱='+@temp5yxbiao+',
二级审批人='+@temp5shrbiao+'
from #temp1,#temp3,#temp5
where #temp1.职员内码=#temp3.职员内码 and #temp1.职员内码=#temp5.职员内码 and #temp1.姓名=#temp1.一级审批人
end'
--exec sp_executesql @j
print @j
set @j='begin
update #temp1
set
ff=#temp5.ff,
F_103='+@temp3yxbiao+',
一级审批人='+@temp3shrbiao+',
二级审批人邮箱='+@temp5yxbiao+',
二级审批人='+@temp5shrbiao+'
from #temp1,#temp3,#temp5
where #temp1.职员内码=#temp3.职员内码 and #temp1.职员内码=#temp5.职员内码 and #temp1.姓名=#temp1.一级审批人
end'
--exec sp_executesql @j
print @j
解决方案 »
- sqlserve某个库中定时查询结果插入一个临时表,后将此临时表插入导入另外一个数据库
- 怎样实现在一个表中的不在同一行同一列的数据想加 没有分了 !!!
- 我的sql2005数据库突然变得很慢是什么原因
- 库存表问题
- 客户在添加记录时, 总是出现重复记录: 库中是用 insert table 的.
- 急,在线等!! 关于数据库还原
- 数据库连接问题
- 急救,在线等(打开Analysis服务的数据库报错)
- 存储过程创建未成功,为何过程名被占用?
- help:数据库为8.1.6,client 端sqlplus 为3.3.2.0.2,连接的时候提示:错误:ORA-03106: 致命的双任务通信协议错,请各位大虾帮助
- 一个关于添加记录得到记录的自增字段的值的问题,急
- 一个追加记录的问题
set @str=' update #temp1 set ff=#temp5.ff,
set @str=@str+' F_103='''+@temp3yxbiao+''','+
set @str=@str+' 一级审批人='''+@temp3shrbiao+''','+
set @str=@str+' 二级审批人邮箱='''+@temp5yxbiao+''','+
set @str=@str+' 二级审批人='''+@temp5shrbiao+''''+
set @str=@str+' from #temp1,#temp3,#temp5 '+
set @str=@str+' where #temp1.职员内码=#temp3.职员内码 '+
set @str=@str+' and #temp1.职员内码=#temp5.职员内码 '+
set @str=@str+' and #temp1.姓名=#temp1.一级审批人 '+
exec(@str)