I am using merge replication with SQL 2012.

I have a table, and it would be useful to propogate that table to the subscribers, but just the table structure, not the actual data.

The data in the table is populated per session, i.e. when you log into the software data is added into the table, and then deleted when you exit the software.

What this means is that the data in the table shouldn't be replicated from publication to subscriber, or from subscriber to publication. But it would be good for the table structure to be replicated so that we don't have to run a script manually at the subscribers.


You can use the command sp_addscriptexec to run an ad-hoc script on all the subscribers.

| improve this answer | |

SQL Server's replication feature is intended to replicate data, not objects like tables. When configuring replication you may find that the slave table may not be a perfect copy of the master table; constraints and indexes may not be recreated on the slave side.

If you need the same table at the slave side, I believe that you should just run the script to create a table and forget about replication.

| improve this answer | |
  • OK, thanks. I just thought there might be a setting somewhere for this, but as far as I can see you are right. – peter Jun 26 '12 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.