Adding a Table to the subscriber DB manually in a Transactional Replication Environment

I need to add a table that exist on the publisher db to the subscriber DB. However it does not have a primaryID and I do not want the data to be replicated just the table structure.( It is a Scratch table that is needed for reporting purposes). My Thought was to just run the table creation script against the Subscriber DB, after replication is setup each time.

  1. will that work
  2. is there a better way ?



more ▼

asked Nov 13, 2009 at 11:29 AM in Default

avatar image

66 4 6 10

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

  1. Yes, that will work.
  2. sp_addScriptExec - this will publish your table script when you run it interactively, but it will also cause the table script to be included whenever you set up in the future.

sp_addScriptExec @publication='your-publication' , @scriptFile = '\\snaphot-storage-location\your-table-script.sql' , @skipError = 1

more ▼

answered Nov 17, 2009 at 12:28 AM

avatar image

25k 3 13 20

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Nov 13, 2009 at 11:29 AM

Seen: 1451 times

Last Updated: Nov 13, 2009 at 11:33 AM

Copyright 2018 Redgate Software. Privacy Policy