HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

SQL Server Replication - Can destination db have stored procedures that source db lacks?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
destinationstoredcanproceduressqlsourcelacksreplicationthatserver

Problem

I'm a developer with a very basic question, but I can't see anything conclusive on MSDN. I'm developing a web application that uses a SQL server 2008 R2 back end. According to this MSDN page, SQL replication can be set up to replicate only certain database objects.

If stored procedures, functions, etc. are created on the destination database (the subscriber in replication parlance) will they survive future replications from the source database? I only need the data from the source system, so the replication need not publish anything but tables.

Solution

Yes, absolutely.

You would typically use transactional replication to move data between the publisher and subscriber(s) (although you can include other objects as well). Your subscriber (destination) database is fully writeable, and you can create stored procedures there, add indexes to replicated tables, and even create entirely new tables.

Be aware, you can also delete data from the replicated tables on the subscriber, which could lead to replication breaking and you having to re-snapshot.

Context

StackExchange Database Administrators Q#161971, answer score: 4

Revisions (0)

No revisions yet.