English 中文(简体)
MSSQL 2008表的变化,最佳方法是什么?
原标题:Track MSSQL 2008 table changes, what is the best method?

我需要从(......)中跟踪一次多指标类集调查表的记录变化。 NET 4.0 申请。 这样做的最佳方法是什么?

更多说明。 我们的会员表从第1号申请中更新。 我们还制定了第2号申请,该申请应跟踪成员表,并就某些成员数据变化发出电子邮件通知。

最佳回答

如果您有一个历史表(与原表格相同的栏目加一个自动加固式电算栏),你可以追踪原表所有变动情况。 您可以跟踪插入、删除和改动。 使用触发器插入、更新和删除,以便把一行列入历史表。 如果你不需要所有这些选择,那么就使用你确实需要的办法。

If you choose to use an IsDeleted flag in the original table, it complicates every query, and leaves your active table with lots of unneeded rows. But that can work, depending on your needs.

check out this link.. for more information.... http://www.codeproject.com/KB/database/DTS_SQLExpress.aspx

问题回答

For DML changes: In SQL Server 2008, you have a built-in feature for this purpose: Change data capture.

For DDL changes: Starting with SQL Server 2005 you have DDL triggers, Example

This is what i think you need to do.

在数据更新时,在KQ表上设定一个触发点,每倍编制一个文件。

创建

在FileWatcher的召回职能中,撰写发送电子邮件通知的编码。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签