import pyodbc conn1=pyodbc.connect('Driver={SQL Server};' 'Server=[server name];' 'Database=A;' 'Trusted_Connection=yes;') conn2=pyodbc.connect('Driver={SQL Server};' 'Server=[server name];' 'Database=B;' 'Trusted_Connection=yes;') cursor=conn1.cursor() cursor.execute('select count(*) from A.table1') for row in cursor: print(row)
Comparing the count of rows from the tables that are present in two different databas
Messages In This Thread |
Comparing the count of rows from the tables that are present in two different databas - by krt5 - Feb-13-2019, 10:03 PM
RE: Comparing the count of rows from the tables that are present in two different databas - by Larz60+ - Feb-13-2019, 10:31 PM
RE: Comparing the count of rows from the tables that are present in two different databas - by krt5 - Feb-13-2019, 10:45 PM
RE: Comparing the count of rows from the tables that are present in two different databas - by Larz60+ - Feb-14-2019, 02:58 AM
RE: Comparing the count of rows from the tables that are present in two different databas - by krt5 - Feb-14-2019, 03:11 AM
RE: Comparing the count of rows from the tables that are present in two different databas - by Larz60+ - Feb-14-2019, 09:20 PM
RE: Comparing the count of rows from the tables that are present in two different databas - by krt5 - Feb-15-2019, 03:20 PM
|
Users browsing this thread: 1 Guest(s)