Reputation:
I have 2 databases one in local and another in clould , need to synchronise stored procedure from local to online. now problem is there are few newer stored procedures in local and i need to migrate them to online , there are 500+ prcedures. Is there any query to find out the procedures which is in local but at online , i cannot overwrite all procedures from local to online because procedure which are already at online are updated
I have backed up online database to my local as well . its name is db2
assuming my existing local database is db1 , i need to findout procedures which are at locak but not at online
Thank you
Upvotes: 0
Views: 1497
Reputation: 204894
Try that
SELECT p1.name, p2.name
FROM db1.sys.procedures p1
full outer join db2.sys.procedures p2 on p1.name = p2.name
where p1.name is null or p2.name is null
It gives you all procedures names that are not in both DBs.
Upvotes: 2