Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

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

share|improve this answer
add comment

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.

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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