question

SSGC avatar image
SSGC asked

How to sync a server stored procedures from other server?

The company have dev/stage/prod server. Stage server will refresh every week from prod server(use prod backup file restore in stage). The new stored procedures in dev server should deploy to stage, but not in prod yet. So when after stage restored, all new stored procedure wipe out from stage server. Company use a job in stage to run after stage refresh. the job put in all new stored procedures. The issue is if people forget put new version stored procedures in this job, the stage server will not run correctly. What is best way to do the sync? Can we use linked server sp_helptext direct deploy new stored procedure to stage from dev server? Thanks.
stored proceduresdeploymentsync
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JohnM avatar image
JohnM answered
You can roll your own using linked servers or something with tablediff. I would probably suggest to use tablediff as it's fairly robust. I personally prefer to use Red Gate's tools (which can be automated) to do schema/data sync'ing. Reference: http://www.red-gate.com/products/sql-development/sql-compare/ Tablediff: https://www.simple-talk.com/sql/sql-tools/sql-server-tablediff-utility/ Hope that helps!
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.