SQL Server 2008新功能 捕获数据变化(3)
2008-04-14 09:54:17 来源:WEB开发网执行结果
ID,Name,Address,Salary,Bonus
homesql2008(HOMEMAK):(0row(s)affected)
homesql2008(HOMEMAK):(1row(s)affected)
homesql2008(HOMEMAK):(1row(s)affected)
homesql2008(HOMEMAK):(1row(s)affected)
homesql2008(HOMEMAK):(1row(s)affected)
homesql2008(HOMEMAK):(1row(s)affected)
ID,Name,Address,Salary,Bonus
1,DancingDoll,221,WestBroadst,
Greenbay,Wisconsin,60000.0000,1000.0000
2,RainbowDance,21,Eastst,
Denville,NewJersey,68000.0000,1300.0000
3,WaterDance,1,SouthBroadst,
Quincy,Massachusetts,76000.0000,1600.0000
4,MickeyMouse,5,Main,
Greenbay,Wisconsin,120000.0000,12000.0000
5,Ratyear,7,Newroad,
Danbury,Connecticut,45000.0000,1600.0000
homesql2008(HOMEMAK):(5row(s)affected)
第七步
更新及删除一些数据,如下:
use[CDCDB]
go
UpdateEmployeesetname='test'whereid=5
go
DeleteEmployeewhereidin(3,4)
Go
第八步
通过以下查询语句查看DDL和DML的变化。[参考图 Fig 1.0 and Fig 1.1]
use[CDCDB]
go
select*fromcdc.ddl_history
go
执行结果
source_object_id,object_id,required_column_update,ddl_command,ddl_lsn,ddl_time
565577053,597577167,0,AlterTableEmployeeaddAddressvarchar(500)
,0x000000360000006B0022,2008-02-0915:03:00.000
565577053,597577167,0,AlterTableEmployeeaddSalarymoney
,0x000000360000007A0018,2008-02-0915:03:00.000
565577053,597577167,0,AlterTableEmployeeaddBonusmoney
,0x00000036000000800018,2008-02-0915:03:00.000
homesql2008(HOMEMAK):(3row(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表' (数...
更多精彩
赞助商链接