如何在数据集中查找最近的更新记录 [英] how to find in dataset check last update records
本文介绍了如何在数据集中查找最近的更新记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
Hi
How to find last update records in table, is possible to check it dataset?
推荐答案
嗨
正如SA所建议的那样,没有直接的方法.您可以做的是在表中添加一列,例如"LastUpdated",并将数据类型定义为TimeStamp.每当您编辑/插入记录时,这就会更新它.
然后,您可以轻松找到最近更新的行/行.
http://msdn.microsoft.com/en-us/library/aa260631 (v = sql.80).aspx [
Hi
As SA suggested, there is no straightforward way. What you can do is to add a column in the table like "LastUpdated" and define datatype as TimeStamp. This will then update it whenever you edit/insert a record.
Then you can easily find the last updated row/rows.
http://msdn.microsoft.com/en-us/library/aa260631(v=sql.80).aspx[^]
Other way could be a query as shown below
SELECT IDENT_CURRENT('TableName')
其中tablename是实际的表名.这将为您提供最后更新的行的ID(主键).
希望有帮助.
谢谢
Milind
Where tablename is actual table name. This wil give you id (primary key) of the last updated row.
Hope that helps.
Thanks
Milind
这篇关于如何在数据集中查找最近的更新记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文