sql server - Change tracking - sys_change_operation are all "I"? -


i created test table.

create table test (id int not null, ......)    on [primary] (data_compression = page) go alter table test add primary key clustered (id)    (data_compression = page) on [primary] go create nonclustered index [ix_timestamp] on test ([timestamp])    (data_compression = page) on [primary] go alter table test enable change_tracking (track_columns_updated = on) 

update: table has trigger writing pks of changes in table

and inserted values in table. updated 1 row using update test set ... id = 1.

however following query returns "i" sys_change_operation? can cause problem? (btw, tried enable cdc, doesn't capture anything.)

select distinct commit_time,sys_change_operation, count(*) -- select *     changetable(changes dbo.test, 0) c     join sys.dm_tran_commit_table tc on c.sys_change_version = tc.commit_ts group commit_time, sys_change_operation 

results:

 commit_time             sys_change_operation count ----------------------- -------------------- ----------- 2014-05-29 22:39:22.397                    5944 2014-05-29 22:47:41.220                    1  (the last row should "u") 

have @ excellent article here. explains why seeing behavior. issue 0 being passed argument changetable.


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -