Background: We have been looking at replication of our SQL Server 2014 databases for a couple of scenarios.One which just works and its hunky dory and the other which just doesn't seem to work, moreover I, after trawling through loads of unhelpful Microsoft technet pages, feel that the only way I will get an answer is to ask somebody who has done this before: - Hence why I have turned to stack overflow.
We have two servers, our main DB and a second DB both running SQL Server 2014 (12.0.4100.1), on Windows Server 2012. These machines are in an Active Directory and can see each other fine.
Scenario 1: We have successfully set up transactional replication from our main database to a reports database. This means our reports application can read this data from the replicated machine and its read only. This works fine. The ID columns are all present and are identical to the ID column on the publisher.
Scenario 2: We have a demo-*. set of sites where we want yesterday's data, and also we want to be able to play with the data, i.e. adding new rows in, deleting rows.. in essence demonstrating, but based on realistic real data... our customers love it when we demo using their real data but in a safe environment.
This helps us with learning and demonstration. We set-up a snapshot replication and the first time we did this it worked fine, however subsequent updates to this are removing or are not publishing the identity property on the ID column (some ID columns are being replicated with the IDENTITY
property intact but for some tables the IDENTITY
property is being removed). This leaves some tables (not all) in a state where I cannot insert a new row.
This is not an issue with identity ranges, as these are being re-seeded with a new range that will not conflict, the issue is that the IDENTITY
property is not present on some of the tables.
Everything I am reading seems to be telling me that I can't do this and I am puzzled because the scenario seems to be obvious to me as I want to have a complete copy of the database from the night before and then I want to play with that data adding and deleting at will (in our scenario the changes are NOT to be pushed back to the publisher) and then the next day it's all wiped out and demo is a fresh clean copy.
However, the issue I face is that after the snapshot replication the published database is unusable and we cannot insert new rows... this is very limiting. We can't find any errors, we cant find anything obvious in Google. So.... How should I set up a Snapshot replication of database a to database b, so that I can do anything I like in database b and it not affect database a. Then the next day database b is reset again to be last nights data?
Reading technet and microsoft pages is frustrating and pointless as it doesn't really "Tell" you anything, it just talks about features and scenarios which don't seem to match mine.. If any stackoverflow'er has a "This is how you should set this up" I would be grateful of the pointer.,
If you are able to say Server a needs to be setup as "x" and server "b" needs to be set up as Y and the type of replication for this database needs to be "z"
Regards and thanks in advance.
Julian and Jamie