如何使用Asp.Net从现有表更新到另一个现有表 [英] How Do I Update From An Existing Table To Another Existing Table Using Asp.Net

查看:82
本文介绍了如何使用Asp.Net从现有表更新到另一个现有表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用asp.net从现有表更新到另一个现有表



表1有值。







表2有一些空值..





i想要更新表2,比较类似的字段。

更新表2中的那些空值。

i将从table1复制到table2(空字段)

并且还提到数据类型..

table 2

date datetime



table1

data varchar(20)

i want to update from an existing table to another existing table using asp.net

table 1 have values.



table 2 have some null values..


i want to update table 2 comparing similar fields.
update those null values in table 2 .
i will copy from table1 to table2 (null fields)
and also mention the datatype..
table 2
date datetime

table1
data varchar(20)

推荐答案

您需要的构造类似于
UPDATE t2
SET t2.field1=t1.field1, t2.field2=t1.field2, etc
FROM table1 AS t1
INNER JOIN table2 as t2 ON t1.emplyeecode=t2.emplyeeid and t1.abc=t2.abc -- might be more
WHERE ... -- insert any condition here


这篇关于如何使用Asp.Net从现有表更新到另一个现有表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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