Sometimes I need to synchonize source codes between development and production server. So, I created this stored procedure to help me do that instead of generating scripts from one server and execute it in another server.
To run this stored procedure, you need to create two linked servers for your source server and your target server. You can create them in local SQL Server and then run this to synchronize.
For example, your development server is called DEV and your production server is called PROD, and you create two linked servers in local SQL Server with the same name. Assumed that your database between DEV and PROD have the same name: TestDB.
If you want to synchronize TestProc stored procedure between TestDB of DEV and PROD, you can excute like that:
EXEC @ProcedureName = 'TestProc', @SourceServer = 'DEV', @SourceDatabase = 'TestDB', @TargetServer = 'PROD', @TargetDatabase = 'TestDB'