关于这个主题有很多想法,但这个是关于 Win32/WinEventProc 的 dwmsEventTime。
MSDN http://msdn.microsoft.com/en-us/library/windows/desktop/dd373885(v=vs.85).aspx指出这是以毫秒为单位的事件时间,但没有提供进一步的解释。毫秒从哪里来?
这是该事件返回的示例值:
dwmsEventTime: 1209382650
DateTime.Now: 05/21/2014 16:49:37 (this should be very close to dwmsEventTime)
Run Code Online (Sandbox Code Playgroud)
有谁知道如何将此参数转换为 .NET DateTime()?
我正在尝试使用MERGE命令插入或更新单个表,但是我总是得到"0行受影响".我的目标很简单:如果存在更新,否则插入.我究竟做错了什么?
注意:表的主键是组合键= [date] + sip + dip + port,其中date是datetime,所有其他字段都是int
merge iplog as t
using (SELECT * from iplog Where [date]='20120101' and sip=1 and dip=2 and port=80) as s
on t.[date]=s.[date] and t.sip=s.sip and t.dip=s.dip and t.port=s.port
when matched then
update set t.size=t.size+s.size
when not matched then
insert values ('20120101',1,2,80,1);
Run Code Online (Sandbox Code Playgroud)