Comments
Sort by recent activity
Hi David
Well the target database is the local development database for the user, so these columns might be uncommitted work in progress.
What I'm trying to achieve here is an automatic update of the local database for a user. We have over a dozen databases, and we need to (ideally) have them all take changes automatically rather than the user having to update them using SQL Source Control in SSMS one at a time as this is time consuming for large databases.
So I need the update to avoid overwriting local changes, add any new changes and if there are any conflicts to throw an error as that will require manual intervention.
I hope I have the right tool for the job - if there was a way to call SQL Source Control form the command line (rather than via SSMS) then that might be better - if we could force a sync when there are no conflicts.
I hope that makes sense [image]
Cheers,
Ciaran
David Atkinson wrote:
Can I ask why it is that you've got additional columns in the target databases that don't exist in source control?
/ comments
Hi David
Well the target database is the local development database for the user, so these columns might be uncommitted work in progress.
What I'm trying to achieve here is an automatic update of t...
Thanks for that - I'd be very interested to know if it can be changed, or if there is some other day to ensure automatic update of local databases from SVN.
The solution we have is not all the way there and of questionable benefit if the local developer still has to do a manual update SSC in SSMS to ensure his local copy is up to date despite this script running.
Thanks for your feedback!
Ciaran / comments
Thanks for that - I'd be very interested to know if it can be changed, or if there is some other day to ensure automatic update of local databases from SVN.
The solution we have is not all the way ...
Wait - I'm actually sort of halfway there now [image]
The options above will preserve any added columns on my local copy, and preserve any added objects (like tables) in my local copy.
But if someone adds a column to a table in the scripts folder via SVN that I have not changed, then it doesn't see that change unless I remove the /exclude:different flag.
But of course if I do that, then any columns I have added to my local database will be removed in the sync.
Is there any way around this?
Thanks in advance. / comments
Wait - I'm actually sort of halfway there now
The options above will preserve any added columns on my local copy, and preserve any added objects (like tables) in my local copy.
But if someone add...
That did it! Thanks for the tip. / comments
That did it! Thanks for the tip.
Hi Eddie - thanks for you response.
That's not doing the trick for me I'm afraid.
So to test this I have created a new table (TestTable) in my target database, and everytime I run the command: sqlcompare /scripts1:"C:\temp\temp-svn\BR" /database2:BR /exclude:Additional /options:iu /ignoreparsererrors /sync
I get the following: Summary Information
===============================================
DB1 = C:\temp\temp-svn\BR
DB2 = (local).BR
Object type Name DB1 DB2
-----------------------------------------------------------------------------------------------------------------------------------------------------
Table [dbo].[TestTable] <<
-----------------------------------------------------------------------------------------------------------------------------------------------------
This blitzed my new table from the target database.
I need the sync to spare any additional tables, any edited table, and really just add any new objects and any changed objects.
FYI:
/exclude:Missing,Different
...throws an error, it doesn't like that comma I think.
Thanks in advance,
Ciaran / comments
Hi Eddie - thanks for you response.
That's not doing the trick for me I'm afraid.
So to test this I have created a new table (TestTable) in my target database, and everytime I run the command:sqlco...
Any further thoughts on this, anyone?
Thanks,
Ciaran / comments
Any further thoughts on this, anyone?
Thanks,
Ciaran
Hi James
Yep, I got 2x matches ! It seems that dir was a little corrupted. Fixed up now.
Many thanks for your help!
james.billings wrote:
Usually, that error would mean that it's finding duplicate definitions. A quick DOS command may help find possibles.... open up a command prompt, navigate to the folder (C:\prog\temp-svn\BR\trunk) then try the following:
findstr /S /C:"CREATE USER xxxxxxxx" *.*
Obviously replace the xxxxxxx with the username. See if that gives multiple matches.
/ comments
Hi James
Yep, I got 2x matches ! It seems that dir was a little corrupted. Fixed up now.
Many thanks for your help!
james.billings wrote:
Usually, that error would mean that it's finding duplicate...
That works great. Thanks! / comments
That works great. Thanks!
Hi Chris
So once I include everything once from the UI, it will remember I included everything with the project info?
Thanks,
Ciaran
Chris Auckland wrote:
Thanks for your post.
If you run the project in the UI, and then on the comparison results grid check the top level 'include in synchronization' tick-box, i.e. so everything gets included, and then save the project. It should include everything when you call the project from the command line.
I hope this helps. [/img]
/ comments
Hi Chris
So once I include everything once from the UI, it will remember I included everything with the project info?
Thanks,
Ciaran
Chris Auckland wrote:
Thanks for your post.
If you run the proj...
Hi Chris
We are using the 'dedicated' model. Took your suggestion on board, re-linked and it pointed out a lot of conflicts, so we just took the versions from source control and now all is well.
Thanks for the help! / comments
Hi Chris
We are using the 'dedicated' model. Took your suggestion on board, re-linked and it pointed out a lot of conflicts, so we just took the versions from source control and now all is well.
Th...