How can we help you today? How can we help you today?
Andy_PS

Activity overview

Latest activity by Andy_PS

That seemed to work fine and seems to be the last of the problems [image] (for now [image] ) Here's my final code #region SynchroniseSchema public static void SynchroniseSchema(string server, string database, string snapshotPath) { ConnectionProperties connectionProperties = new ConnectionProperties(server, database); //AJ: Fudge for problem with Extended Properties SynchroniseSchemaExcludingExtendedProperties(connectionProperties, snapshotPath); SynchroniseSchema(connectionProperties, snapshotPath); } public static void SynchroniseSchema(string server, string database, string username, string password, string snapshotPath) { ConnectionProperties connectionProperties = new ConnectionProperties(server, database, username, password); //AJ: Fudge for problem with Extended Properties SynchroniseSchemaExcludingExtendedProperties(connectionProperties, snapshotPath); SynchroniseSchema(connectionProperties, snapshotPath); } private static void SynchroniseSchema(ConnectionProperties liveConnectionProperties, string snapshotPath) { Database liveDatabase = new Database(); liveDatabase.Register(liveConnectionProperties, Options.Default); Database snapshotDatabase = new Database(); snapshotDatabase.LoadFromDisk(snapshotPath); Differences differences = liveDatabase.CompareWith(snapshotDatabase, Options.Default); foreach (Difference difference in differences) { difference.Selected = true; } Work work = new Work(); work.BuildFromDifferences(differences, Options.Default, false); ExecutionBlock executionBlock = work.ExecutionBlock; BlockExecutor blockExecutor = new BlockExecutor(); blockExecutor.ExecuteBlock(executionBlock, liveDatabase.ConnectionProperties.ServerName, liveDatabase.ConnectionProperties.DatabaseName, liveDatabase.ConnectionProperties.IntegratedSecurity, liveDatabase.ConnectionProperties.UserName, liveDatabase.ConnectionProperties.Password); } //AJ: Fudge for problem with Extended Properties //AJ: To solve the problem use a 2 pass approach, //AJ: first without Extended Properties and then with. //AJ: http://www.red-gate.com/MessageBoard/viewtopic.php?t=4433 private static void SynchroniseSchemaExcludingExtendedProperties(ConnectionProperties liveConnectionProperties, string snapshotPath) { Database liveDatabase = new Database(); liveDatabase.Register(liveConnectionProperties, Options.Default | Options.IgnoreExtendedProperties); Database snapshotDatabase = new Database(); snapshotDatabase.LoadFromDisk(snapshotPath); Differences differences = liveDatabase.CompareWith(snapshotDatabase, Options.Default | Options.IgnoreExtendedProperties); foreach (Difference difference in differences) { difference.Selected = true; } Work work = new Work(); work.BuildFromDifferences(differences, Options.Default | Options.IgnoreExtendedProperties, false); ExecutionBlock executionBlock = work.ExecutionBlock; BlockExecutor blockExecutor = new BlockExecutor(); blockExecutor.ExecuteBlock(executionBlock, liveDatabase.ConnectionProperties.ServerName, liveDatabase.ConnectionProperties.DatabaseName, liveDatabase.ConnectionProperties.IntegratedSecurity, liveDatabase.ConnectionProperties.UserName, liveDatabase.ConnectionProperties.Password); } #endregion I could have put the fudge into the 'SynchroniseSchema' method to bring everything into a more oop style, but in this case I decided to keep the fudge separate so it's easy to see what needs changing when the issue is fixed. Thanks for all your help [image] You've been very speedy and hit the mark every time with the problems I've had [image] / comments
That seemed to work fine and seems to be the last of the problems (for now ) Here's my final code #region SynchroniseSchema public static void SynchroniseSchema(string server,...
0 votes
Unfortunatly we use extended properties to provide meta data to the DAL. I'll try the 2 pass approach, since it'll only be done during an update the extended time needed shouldn't be too much of a concern [image] / comments
Unfortunatly we use extended properties to provide meta data to the DAL. I'll try the 2 pass approach, since it'll only be done during an update the extended time needed shouldn't be too much of a ...
0 votes
Property cannot be updated or deleted
Property cannot be updated or deleted. Property 'SqlAssemblyFileLine' does not exist for 'dbo.up_CLR_RotaAppointmentTransfer'. Had a search on the forums and the web in general and I can't see w...
2 followers 7 comments 0 votes
Yup that sorted that one [image] For the record would you prefer me to keep it as 1 problem per thread? or post any other problems i come up against on this thread? / comments
Yup that sorted that one For the record would you prefer me to keep it as 1 problem per thread? or post any other problems i come up against on this thread?
0 votes
Yes I am (using the same code). Yes I do (though in this case it was the correct assumption [image] ) And that sounds spot on ... I shall swap Options.None to Options.Default and give it a blast! / comments
Yes I am (using the same code). Yes I do (though in this case it was the correct assumption ) And that sounds spot on ... I shall swap Options.None to Options.Default and give it a blast!
0 votes
DROP ASSEMBLY failed
Ok got another one. Hopefully its as painfully obvious as my last question.DROP ASSEMBLY failed because 'PremierSoftware.SqlServer.BusinessData' is referenced by object 'up_CLR_StockHeaderSearch'. ...
2 followers 3 comments 0 votes
"Object reference not set to an instance of an object."
Heres my code: Database liveDatabase = new Database(); liveDatabase.RegisterForDataCompare(liveConnectionProperties); Database snapshotDatabase =...
2 followers 2 comments 0 votes