如何在特定表中显示最近更新的列。 [英] How to display the recently updated column in particular table.

查看:73
本文介绍了如何在特定表中显示最近更新的列。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最初,我有一个名为Mytable的表格。我创建了另一个表格,如Mytable和Mytable。并将其命名为Mytable_duplicate。

我已将所有记录转储到Mytable中。将数据转换为Mytable_temp。并使用主键列修改了Mytable_temp表的一个列值(我已将主键列放在where条件中)。



我的查询是想要在Mytable_temp中获取以前的数据和修改后的数据。

Initially i have one table with name "Mytable".And i have created another table same like "Mytable" and name it as "Mytable_duplicate".
And i have dump all the records in "Mytable" data into "Mytable_temp".And modified "Mytable_temp" table's one column value by using the primary key column(I have put the primary key column in where condition).

My query is i want to get the previous data and modified data in "Mytable_temp".

推荐答案

您无法直接获取该数据。首先,在要更新的表上写入Trigger。请参阅:触发器 - SQL Server [ ^ ]



请参阅此链接:什么是魔法表。不同类型的魔法表 [ ^ ]



获得旧数据后[在删除表中],你可以将它存储在某些表中。根据您的需要从那里获取数据并将其绑定到Gridview。



问候..
You can not directly get that data. First, write Trigger on the table which you are updating.See this : Triggers -- SQL Server[^]

And then refer this link : what is magic table.different types of magic table[^]

Once you get the old data [in deleted table], you can store it in some table say. Get data from there as per your need and bind it to Gridview.

Regards..


这篇关于如何在特定表中显示最近更新的列。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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