From the course: SQL Server 2022 Administration

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Read secondary database copies

Read secondary database copies - SQL Server Tutorial

From the course: SQL Server 2022 Administration

Read secondary database copies

So depending on which high availability solution you're using for your Microsoft SQL Server databases, there's various ways that you can read the secondary data. If you're using replication and if you go look at the replication lesson, you'll know that in transactional replication I can read from my secondary copy, in fact, my secondary copies of full blown database and I can write to that database. Now, I wouldn't recommend that because you can cause problems with your replication. So replication is all about moving data across the wire. And in order to do that, part of what it needs is a primary key. So if I update a row, it needs to know that I can go to the secondary server and update the same row by passing in the same data and referencing the primary key. If I delete a row from a primary, it needs to go find that row in the secondary and delete it based on its primary key. So a couple of things can happen if I start writing to that secondary database. One, if I mess with the…

Contents