x

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 ?

Thanks

Brian

more ▼

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

Brian gravatar image

Brian
36 4 4 6

(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

KenJ gravatar image

KenJ
20k 1 3 12

(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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

SQL Server Central

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

Topics:

x1950
x305

asked: Nov 13, 2009 at 11:29 AM

Seen: 1260 times

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