question

Brian avatar image
Brian asked

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

sql-server-2005replication
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
KenJ avatar image
KenJ answered
  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

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.