How can we help you today? How can we help you today?
lc6529

Activity overview

Latest activity by lc6529

XML Comparison Columns
When using an XML File, Is There A Way To Tell SQLDataCompare Which Columns to use in the comparison? I have two tables to compare and without getting into a lot of detail, I need to compare the no...
2 followers 3 comments 0 votes
SQL Data Compare - Exclude Rowguid From Comparison
Getting Closer. I have setup an XML Argument file to compare two tables on two different servers and put the output of the comparison into a log file. The tables are identical except for 2 things. ...
0 followers 0 comments 0 votes
SQLDataCompare - EXCLUDE Column In XML File
So in my last episode, I was setting up a DATACOMPARISON using an XML file. Table 1 is to be compared to Table 2. Table 1 has jobs run against it which delete data from the table. The comparison ...
0 followers 0 comments 0 votes
Redgate SQL Compare XML Syntax INCLUDE Syntax
I am trying to compare a table that exists in separate databases on two different servers. Table 1 is the master, there is a job that will truncate all data once a week and then repopulate it. Tabl...
2 followers 2 comments 0 votes
XML Command Line Switches...
I currently have a batchfile calling SQLDATACOMPARE to compare 1 table on two different servers, the target table is only supposed to have rows added or modified NOT deleted so I use the command li...
2 followers 3 comments 0 votes
After a lot of digging, I came up with this code, however oRedGateSession.TableDifferences.Count always returns 0 even if I delete all records from one of my tables. If I run the command line SQLDATACOMPARE /SYNC /PROJECT:"C:\Sync_Labelvision_Master.SDC" Which uses the SAME project...the tables are synced. How can I get the code to work? Sub SyncDatabases(ByVal sServerName As String) ' ' Copied From Synchronizing,Data Example In Help File ' Dim objProject As RedGate.SQLDataCompare.Engine.Project = RedGate.SQLDataCompare.Engine.Project.LoadFromDisk("C:\Sync_Labelvision_Master.SDC") ' ' Set Up Our Databases ' Dim dbMaster As New Database Dim dbTarget As New Database Dim tblMappings As New TableMappings Dim oLivedb As LiveDatabaseSource ' ' Register First DB For Comparison ' oLivedb = DirectCast(objProject.DataSource1, LiveDatabaseSource) dbMaster.RegisterForDataCompare(oLivedb.ToConnectionProperties()) ' ' Register Second DB For Comparison ' oLivedb = DirectCast(objProject.DataSource2, LiveDatabaseSource) dbTarget.RegisterForDataCompare(oLivedb.ToConnectionProperties()) tblMappings.Options = objProject.Options tblMappings.CreateMappings(dbMaster.Tables, dbTarget.Tables) Try Dim oRedGateSession As New ComparisonSession oRedGateSession.Options = objProject.Options oRedGateSession.CompareDatabases(dbMaster, dbTarget, tblMappings, SessionSettings.Default) If oRedGateSession.TableDifferences.Count > 0 Then Dim oProvider As New SqlProvider Dim oExBlock As ExecutionBlock oExBlock = oProvider.GetMigrationSQL(oRedGateSession, True) Dim stream As IO.FileStream = oExBlock.GetFileStream() Dim oBExecutor As RedGate.SQL.Shared.BlockExecutor = New BlockExecutor oBExecutor.ExecuteBlock(oExBlock, sServerName, "labelvision_master", True, "lvadmin", "lvadmin") oExBlock = oProvider.Block If (TypeOf oExBlock Is ExecutionBlock) Then oExBlock.Dispose() End If oRedGateSession.Dispose() Catch ex As Exception MsgBox(ex.Message) Finally End Try ' ' dispose of the objects to delete temporary files ' dbMaster.Dispose() dbTarget.Dispose() End Sub / comments
After a lot of digging, I came up with this code, however oRedGateSession.TableDifferences.Count always returns 0 even if I delete all records from one of my tables. If I run the command line SQLD...
0 votes
Compare Not Working In VB.NET
Ok, I am stubborn. I have the project working from the command line using SQLDATACOMPARE /PROJECT:"C:\ProjectName.SDC" but I cannot seem to get this to work in my VB.NET project. I don't get any ...
1 follower 1 comment 0 votes