Get cdc tables in visual studio 2012/2010 database project -
i trying create database project in visual studio 2012/2010 need cdc (change data capture) tables , because lot of views dependent on cdc tables. couldn't find way import cdc schema/tables :(. read in many blogs importing cdc not supported. there work around. please suggest
generally wouldn't want cdc tables created database project, want them created using sys.sp_cdc_enable_table
if allow database project create tables in normal manner cdc tables end existing change data capture wouldn't enabled.
obviously can script calls sys.sp_cdc_enable_table in either pre or post scripts, far can tell neither place ideal.
if put sys.sp_cdc_enable_table calls in pre script changes not original tables exist (on fresh deploy none of them exist), or these original tables change shape part of main deploy occurs after pre run.
if put sys.sp_cdc_enable_table calls in post script, can't have views rely on cdc tables existing deployed part of main database project deployment (not without errors or warnings in db project).
i suggest not having many views, functions or stored procs rely on existence of cdc tables, sounds might late that.
side note: speaking should using cdc.fn_cdc_get_all_changes_ , cdc.fn_cdc_get_net_changes_ functions rather referencing cdc tables directly, see querying change data capture data
however, moves problem along 1 level functions not existing in project.
unfortunately, there doesn't seem way have views without scripting them @ same point script calls sys.sp_cdc_enable_table
(i'm hoping else come along better answer solves problem)
Comments
Post a Comment