WEB开发网
开发学院数据库MSSQL Server SQL Server 2008新功能 捕获数据变化(2) 阅读

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_mappi

执行结果

  homesql2008(HOMEMAK):(1row(s)affected)
  homesql2008(HOMEMAK):(1row(s)affected)

SQL Server 2008新功能 捕获数据变化(2)

图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)

上一页  1 2 3 4 5  下一页

Tags:SQL Server 新功能

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接