UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Auto Check Different Between Database, SQL Server 2008 R2    
 
   
mr.siro
post Sep 9 2019, 04:42 AM
Post#1



Posts: 183
Joined: 27-January 18



Hello guys, i have two database: WorkData(primary database) and TestData(test database).
After i done with TestData,if every thing is good, i will update WorkData which same changes in TestData, EX: Delete or add or update structure of table, SP, view,........
But i update WorkData by manually, if i forget only one of changes, it's will terrible.
So, i want to know, have a way to auto check what is different between WorkData and TestData, after that auto update structure in WorkData like TestData ?
This post has been edited by mr.siro: Sep 9 2019, 04:45 AM
Go to the top of the page
 
nvogel
post Sep 9 2019, 05:37 AM
Post#2



Posts: 1,011
Joined: 26-January 14
From: London, UK


You should modify both the work and the test database using a script (or scripts). Apply the script in test, test the results, then apply the same script in the work database. Where possible you can regularly copy and restore the work database to test, although you may need procedures in place to remove or obfuscate any sensitive data.

Usually the change scripts are checked into source control along with any other source code.

Don't ever rely upon the SQL Server Management Studio user interface to modify a database that is important to you. The Management Studio UI does too many risky or disruptive things. For example if you use the designer UI screen to modify columns it sometimes happens that the entire table gets recreated, the data is copied and then the old table is dropped. In an environment with live data that's really not a good idea.

If you actually need to compare objects between two databases you can use various tools to do it. Microsoft offer a free to download tool called SQL Server Data Tools (SSDT). There are also third party tools like Red Gate SQL Compare.

Go to the top of the page
 
GroverParkGeorge
post Sep 9 2019, 08:24 AM
Post#3


UA Admin
Posts: 35,886
Joined: 20-June 02
From: Newcastle, WA


I've used the Redgate Tools with success. They are not cheap, but they are, IMO, worth it.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
Jeff B.
post Sep 9 2019, 08:25 AM
Post#4


UtterAccess VIP
Posts: 10,304
Joined: 30-April 10
From: Pacific NorthWet


Are you only interested in comparing the structures of the dbs, or will you also need to compare the data in each?

--------------------
Regards

Jeff Boyce
Microsoft Access MVP (2002-2015)

Mention of hardware or software is, in no way, an endorsement thereof. The FTC of the USA made this disclaimer necessary/possible.
Go to the top of the page
 
mr.siro
post Sep 9 2019, 08:53 AM
Post#5



Posts: 183
Joined: 27-January 18



QUOTE
Are you only interested in comparing the structures of the dbs, or will you also need to compare the data in each?

just structures, don't need to data
Go to the top of the page
 
nvogel
post Sep 9 2019, 09:37 AM
Post#6



Posts: 1,011
Joined: 26-January 14
From: London, UK


SSDT and Reg Gate tools are two options:

https://docs.microsoft.com/en-us/SQL/ssdt/h...ase-definitions
https://www.red-gate.com/products/SQL-devel...nt/SQL-compare/

For questions related to SQL Server generally you may find these resources helpful:

https://stackoverflow.com/questions/tagged/SQL-server
https://www.sqlservercentral.com/forums
Go to the top of the page
 
mr.siro
post Sep 14 2019, 03:19 AM
Post#7



Posts: 183
Joined: 27-January 18



hello guys, SQL compare redgate is good. But, can i use sqlcompare though internet? How to use another computer that compare two database in server computer though internet?
Go to the top of the page
 
nvogel
post Sep 14 2019, 03:55 AM
Post#8



Posts: 1,011
Joined: 26-January 14
From: London, UK


You can compare any two servers that you can connect to. The comparison happens client-side so if you can connect to both servers from Management Studio you should be able to compare them.
Go to the top of the page
 
GroverParkGeorge
post Sep 14 2019, 09:04 AM
Post#9


UA Admin
Posts: 35,886
Joined: 20-June 02
From: Newcastle, WA


That's exactly how I use the tools. Comparing a local (development) SQL Server to a remote (production) SQL Server in order to synchronize them.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th October 2019 - 07:04 AM