在SQL日志中获取旧值(* .ldf文件) [英] Get old values in SQL log ( *.ldf file)

查看:73
本文介绍了在SQL日志中获取旧值(* .ldf文件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用基于一个数字序列(LSN)的sql命令fn_dblog读取LOG文件



'm trying to read the LOG file using the sql command fn_dblog based in one sequence of numbers ( LSN )

Select * from fn_dblog('00000203:00000085:0002','000000204:00000136:0010')





BUt,当我执行该命令时,我收到错误,说代码无效......我做了一些基于此的研究网站 [ ^ ]但是,或者我得到了一个错误,或者,当我用两个NULL参数执行命令时,我只是得到2 ro信息的ws ...我很体贴这是有意义的,因为当我使用程序读取数据日志时,我得到了所有信息。



我怎么样可以使用SQL读取所有 OLD 数据和日志信息,与数据库中的新信息进行比较?

我知道,有一些程序可以实现,比如ApexSQL LOG和mdfview,但是,我想知道,如何在SQL中创建它,或者我如何在C#中创建它。



如果你看到图片,该程序返回行后更新后的新旧信息。

图片 [ ^ ]



所以,该程序从* _LOG.ldf文件中获取信息并与* .mdf文件进行比较以显示新旧值。

我尝试了 this [ ^ ] ......但是,第一个< b> SELECT 什么都不返回......



那么,我怎样才能从数据库中读取信息,新旧信息? (最重要的是旧信息,因为我可以比较数据)



谢谢。



BUt, when I execute that command, I got an error, saying that the code is invalid... I did some studies based on this site[^] about LSN and log files... but, or I got an error, or, when I execute the command with the two NULL parameters, I just got 2 rows of informations... I considerate that is intresting, because, when I use a program to read the data-log, I got all the information's.

How I can make to read all OLD data and information of log using SQL, to compare with new information in database ?
I know, have some programs make that, like ApexSQL LOG and mdfview, but, I want to know, how to make this in SQL or, how I can make this in C#.

If you see in picture, that program return the new and old information, after update in row.
Image[^]

So, that program get the information from *_LOG.ldf file and compare with *.mdf file to show the new and old value.
I tryed this[^] too... but, the first SELECT return nothing...

So, how I can make to read that informations, old and new information from database ? ( the most important is the old information, for I can compare the data )

Thanks.

推荐答案

SELECT * FROM fn_dblog(NULL,NULL)返回所有日志。传入的两个参数是您希望输入的日志序列号。当您使用互联网上的代码并且没有时间去理解它时会发生这种情况。



这个 [ ^ ]似乎是一个很好的概述。
SELECT * FROM fn_dblog(NULL, NULL) returns all the logs. The two params you pass in are the log sequence numbers you want entries between. This is what happens when you use code off the internet and don't take time to understand it.

This[^] seems like a good overview.


这篇关于在SQL日志中获取旧值(* .ldf文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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