AWS DMS - primary key verification
Hi there, I am planning to migrate our on-prem SQL Server to RDS SQL Server. Unfortunately, this db was managed by several people and we are not sure that all of the tables have a primary key. I wish to keep the on-prem db and RDS in sync for a couple of days, so I have to be 100% sure that all tables have a primary key. Do you know an automatic way, where I can check if all the tables (1000+) have a primary key? Cheers, Mark
This little snippet will tell you whether a table has a primary key or not - SELECT OBJECTPROPERTY(OBJECT_ID(N'TabA'),'TableHasPrimaryKey')
Returns 0 if no primary key, Returns 1 if there is a primary key.
Now all that's left is to get the list of all your tables from the INFORMATION_SCHEMA -
SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
Hello, You may use the SQL Server diagnostic support script, which will list down all possible issues in replication.
https://docs.aws.amazon.com/dms/latest/userguide/CHAP_SupportScripts.html
Relevant questions
Is it possible to use AWS RDS SQL Server as an AAG target from on premise primary?
asked 7 months agoHow to migrate DB on premise Oracle to Microsoft SQL Server DB in AWS. We see SCT will not allow MS SQL Server as Target when source is Oracle. Looking for tools like SCT to move Schema from Oracle.
asked 23 days agoAnnouncement: Amazon RDS for SQL Server ending support for Microsoft SQL Server 2012
asked a month agoDMS CDC for SQL Server - Replication
Accepted AnswerSQL Server BYOL option missing
Accepted Answerasked 4 years agoRDS Sql Server support for 15.0.4198.2
asked 3 months agoAWS DMS - primary key verification
Accepted Answerasked 5 months agoDMS to migrate SQL Server from RDS to EC2
asked 2 years agoRDS SQL Server upgrade downtime
Accepted Answerasked 2 years agoGeneral questions regarding RDS SQL Server Read Replicas
Accepted Answerasked 2 years ago