SQL Server 2008新功能 捕获数据变化(2)
2008-04-14 09:54:13 来源:WEB开发网执行结果
homesql2008(HOMEMAK):(1row(s)affected)
homesql2008(HOMEMAK):(1row(s)affected)
图Fig 1.5
查询表lsn_time_mapping,如下所示:
select * from cdc.lsn_time_mapping
执行结果
start_lsn,tran_begin_time,tran_end_time,tran_id
0x0000001C0000018B002F,2008-01-1601:53:38.840,2008-01-1601:53:38.840,0x00000000029C
0x0000001C000001920003,2008-01-1601:53:38.857,2008-01-1601:53:38.857,0x00000000029F
0x0000001C000001930003,2008-01-1601:53:38.857,2008-01-1601:53:38.857,0x0000000002A0
0x0000001C000001940003,2008-01-1601:53:38.857,2008-01-1601:53:38.857,0x0000000002A1
0x0000001C000001950003,2008-01-1601:53:38.857,2008-01-1601:53:38.857,0x0000000002A2
0x0000001C000001BB0004,2008-01-1602:08:37.357,2008-01-1602:08:37.357,0x0000000002B1
homesql2008(HOMEMAK):(6row(s)affected)
我们可以看到,在表中有一条新的lsn记录。
查询表cdc.dbo_MyTable_CT,如下所示
select * from cdc.dbo_MyTable_CT
执行结果
__$start_lsn,__$end_lsn,__$seqval,__$operation,__$update_mask,ID,Name
0x0000001C0000018B002F,NULL,0x0000001C0000018B002E,2,0x03,1,DanceDoll
0x0000001C000001920003,NULL,0x0000001C000001920002,2,0x03,2,RainbowColors
0x0000001C000001930003,NULL,0x0000001C000001930002,2,0x03,3,RiverDance
0x0000001C000001940003,NULL,0x0000001C000001940002,2,0x03,4,MickeyMouse
0x0000001C000001950003,NULL,0x0000001C000001950002,2,0x03,5,UniversalStudios
0x0000001C000001BB0004,NULL,0x0000001C000001BB0002,1,0x03,4,MickeyMouse
homesql2008(HOMEMAK):(6row(s)affected)
- ››sql server自动生成批量执行SQL脚本的批处理
- ››sql server 2008亿万数据性能优化
- ››SQL Server 2008清空数据库日志方法
- ››sqlserver安装和简单的使用
- ››SQL Sever 2008 R2 数据库管理
- ››SQL SERVER无法安装成功,sqlstp.log文件提示[未发...
- ››Sql Server中通过父记录查找出所有关联的子记录
- ››SqlServer触发器、存储过程和函数
- ››SQL Server 中的事务(含义,属性,管理)
- ››Sqlite数据库插入和读取图片数据
- ››Sql server 2005拒绝了对对象 'xx表' (数...
- ››Sql server 2005拒绝了对对象 'xx表' (数...
更多精彩
赞助商链接