Comparing Views and Trigger between dbs with different names
ramben76
Posts: 2
Hi, I'm trying to compare the triggers and views from 2 different environments (PROD and DEV)
ENV PROD with databses:
A) DB_PROD
DB_PROD_AUDIT
ENV DEV with databases
A) DB_DEV
DB_DEV_AUDIT
DB_PROD triggers insert rows in DB_PROD_AUDIT
DB_DEV triggers insert rows in DB_DEV_AUDIT
When comparing tables between DB_PROD and DB_DEV, all of them are different because the triggers are inserting rows in 2 differents DBS
TRIGGER_IN_PROD (INSERT INTO DB_PROD_AUDIT..TABLE SELECT ...)
TRIGGER_IN_DEV (INSERT INTO DB_DEV_AUDIT..TABLE SELECT ...)
of course the trigger bodies are different because of the db name where the insert occurs, but I wanted to treat them like the same, because they are doing the same.
IS THERE A WAY IN SQL COMPARE TO SAY
treat this text in this object as this other text ? so the objects could be the same and I won't see the differences in the result (or the script to sync the databases)
SAME HAPPENS WITH VIEWS (and all objects with body: Stored procedures, etc)
VIEWS in PROD SELECT * FROM DB_PROD_AUDIT..
VIEWS in DEV SELECT * FROM DB_DEV_AUDIT..
all views are differents because of the database where the table resides, but I want to treat DB_PROD_AUDIT as DB_DEV_AUDIT
I hope you understand my question, because I'm not good at english.
THANKS.
ENV PROD with databses:
A) DB_PROD
DB_PROD_AUDIT
ENV DEV with databases
A) DB_DEV
DB_DEV_AUDIT
DB_PROD triggers insert rows in DB_PROD_AUDIT
DB_DEV triggers insert rows in DB_DEV_AUDIT
When comparing tables between DB_PROD and DB_DEV, all of them are different because the triggers are inserting rows in 2 differents DBS
TRIGGER_IN_PROD (INSERT INTO DB_PROD_AUDIT..TABLE SELECT ...)
TRIGGER_IN_DEV (INSERT INTO DB_DEV_AUDIT..TABLE SELECT ...)
of course the trigger bodies are different because of the db name where the insert occurs, but I wanted to treat them like the same, because they are doing the same.
IS THERE A WAY IN SQL COMPARE TO SAY
treat this text in this object as this other text ? so the objects could be the same and I won't see the differences in the result (or the script to sync the databases)
SAME HAPPENS WITH VIEWS (and all objects with body: Stored procedures, etc)
VIEWS in PROD SELECT * FROM DB_PROD_AUDIT..
VIEWS in DEV SELECT * FROM DB_DEV_AUDIT..
all views are differents because of the database where the table resides, but I want to treat DB_PROD_AUDIT as DB_DEV_AUDIT
I hope you understand my question, because I'm not good at english.
THANKS.
Comments
David Atkinson
Red Gate Software
Product Manager
Redgate Software