Failed to add replica to availability group : different sql server editions - sql-server-2016

I have 2 sql instaces with 2016 SP 2
I verfied the version on both servers and make sure they are identical but still cannot add replica because of this error
the result of ##version on both servers
full error message

Related

SQL Server Always On Availability Group stuck in "Synchronizing / In Recovery"

I'm trying to create an Always On AG between SQL Server 2017 and SQL Server 2019 instances with a very simple database (just a single table test database for proof of concept).
Everything appears to work fine except the secondary replica is stuck in "Synchronizing / In Recovery" status in SSMS.
I cannot connect to the replica even though I marked it as allowing all connections.
If I make changes to the database and fail over to the replica, the changes are there. Everything LOOKS ok but I cannot connect to the replica, with either a normal connection string or a with read only intent.
I saw the below topic and see that the resolution was to use the same version of SQL Server on both replicas. I would ideally like to use 2017 on my primary and 2019 on the secondary as that is our current production environment. If I can get the AG group up that will ultimately allow me to bring SQL Server 2017 instance up to SQL Server 2019 without downtime.
Databases stuck in “Synchronized / In Recovery” mode after adding server to SQL Avaylability Group
SSMS status
AG Group status query
When you have different versions like this, the system can't run recovery. If it did, the AG would then be useless, as you couldn't go back. And without it, you can't access it.

Making ONE single JOB for 2 Separate SQL Agents running on SQL2008 and SQL 2016

Scenario:
2 servers - SQL2008 and SQL2016
Job 1 : Backup - Scheduled SQL Agent Job running for 2 Databases on SQL2008 with the destination on SQL2016 server
Job 2 : Restore - Scheduled SQL Agent Job running for 2 Databases on SQL2016 from the that location.
So thinking of making these 2 individual into a single job for Backup and Restore.
Please help/guide me to combining these 2 Jobs.
Do I Use Powershell or SQL for getting this correct?
When communicating between two servers, the best way I know is to create a Linked Server going both-ways, and on each server. The only gotcha is to make sure the SQL syntax used to select or insert data from a server, is compliant with that server, or the linked server.
From SQLShack...
"Linked servers allow submitting a T-SQL statement on a SQL Server instance, which returns data from other SQL Server instances. A linked server allows joining data from several SQL Server instances using a single T-SQL statement when data exists on multiple databases on different SQL instances. By using a linked server to retrieve data from several SQL instances, the only thing that should be done is to connect to one SQL instance.
There are two ways of configuring linked server in SSMS. One way is by using sp_addlinkedserver system stored procedure and another is by using SQL Server Management Studio (SSMS) GUI interface."
Without writing out the SQL code for both backups and restores, I suggest you read up on Linked Servers, and apply them into your code. I recommend you test the code first manually, outside of a job, and then apply it to a scheduled job or Maintenance Plan.
But as a hint :), try the syntax when linking your table from a linked server object:
[LINKED SERVER].[DATABASE].[Schema].[TableName]

replication multiple databases into one database

Before the question I want to explain what I'm trying to do.
I'm using SQL Server 2016 and I have 2 databases
DataBaseA
DataBaseB
In a remote server I created the same databases using the same creation SQL scripts that i used for DataBaseA and DatabaseB. Then I used the replication service from SQL Server 2016. My local database is the publisher and the remote server is the subscriber.
This worked fine.
What I want to do is having one database in the remote server that contains all tables from both databases and the 2 databases replicate to their corresponding tables.
For example
[DataBaseA].[dbo].[TableA] ---is Replicated into-->[AggregatedDataBase].[dbo].[TableA]
[DataBaseB].[dbo].[TableB] ---is Replicated into-->[AggregatedDataBase].[dbo].[TableB]
Is this possible? If yes how to do it else what other options to do what I'm looking for?
Yes,it is possible..two different publishers can have one subscriber..
If yes how to do it
Just set up the way you set up replication and while selecting subscriber choose aggregated database

SQL Replication Publisher thinks Subscriber is wrong version

I have two SQL Server 2008 instances, one running Workgroup Edition (publisher) and the other Standard (subscriber)
I am trying to replicate a database but I am getting errors when it tries to create the database at the subscriber because it thinks it is running SQL Server 2005 for some reason.
Has anyone had this issue before?
I am getting this error
Column Location in object Members contains type Geography, which
is not supported in the target server version, SQL Server 2005.
Have you checked compatibility mode for the databases?
For example:
SELECT compatibility_level
FROM sys.databases WHERE name = 'YourDBName';

SQL Server 2008 R2 Linked Server to another SQL Server 200r R2 select query error Invalid data for type "Numeric"

we are having the following error message on a SQL Server 2008 R2 with SP1 linked server to another SQL Server 2008 R2 with SP2. The error message is: Invalid data for type "numeric" and is happening intermittently. It worked for couple months and re-appearing again. Called Microsoft Support last July 2012, they haven't able to solve it either and we closed the case after it mysteriously disappeared. All we did is just applied some Windows OS patches before the problem disappeared. Now the problem is re-appearing. The error message was from a simple query
select *
from Sales_LinkedServer].sales.dbo.temp_sales_detail
However, this table contains over 2 millions records. Tried and still failed using the
OPENQUERY:
Select *
From OPENQUERY ([Sales_LinkedServer],
'Select *
From Sales.dbo.temp_sales_detamil');
Also, this is happening on our production server but the similar Dev server has no problem at all.