Scripting data to file...
Trikeb
Posts: 13
Hi,
I'm trying to script the data to a SQL script file using the following code...
database = New RedGate.SQLCompare.Engine.Database
database.RegisterForDataCompare(New RedGate.SQLCompare.Engine.ConnectionProperties(serverName, databaseName, "sa", "sa"), Options.Default)
Dim mappings As New SchemaMappings
mappings.CreateMappings(database, Nothing)
Dim session As New ComparisonSession()
session.CompareDatabases(database, Nothing, mappings)
Dim provider As New SqlProvider
Dim m_DataBlock = provider.GetMigrationSQL(session, False)
blocksaver.FileName = "c:\data.sql"
blocksaver.EncodingType = EncodingType.UTF8
blocksaver.ExecutionBlock = m_DataBlock
blocksaver.SaveToFile()
I get the following error:
Method not found: 'Void RedGate.SQLCompare.Engine.Mappings.CreateMappings(RedGate.SQLCompare.Engine.SerializableCollection, RedGate.SQLCompare.Engine.SerializableCollection, Boolean)'
What is the proper way to accomplish what I want? (Which is to script the entire data of my database to a *.sql file in order to use it later on to synchronize the content of a client database with the generated script.)
Thanks in advance,
I'm trying to script the data to a SQL script file using the following code...
database = New RedGate.SQLCompare.Engine.Database
database.RegisterForDataCompare(New RedGate.SQLCompare.Engine.ConnectionProperties(serverName, databaseName, "sa", "sa"), Options.Default)
Dim mappings As New SchemaMappings
mappings.CreateMappings(database, Nothing)
Dim session As New ComparisonSession()
session.CompareDatabases(database, Nothing, mappings)
Dim provider As New SqlProvider
Dim m_DataBlock = provider.GetMigrationSQL(session, False)
blocksaver.FileName = "c:\data.sql"
blocksaver.EncodingType = EncodingType.UTF8
blocksaver.ExecutionBlock = m_DataBlock
blocksaver.SaveToFile()
I get the following error:
Method not found: 'Void RedGate.SQLCompare.Engine.Mappings.CreateMappings(RedGate.SQLCompare.Engine.SerializableCollection, RedGate.SQLCompare.Engine.SerializableCollection, Boolean)'
What is the proper way to accomplish what I want? (Which is to script the entire data of my database to a *.sql file in order to use it later on to synchronize the content of a client database with the generated script.)
Thanks in advance,
Jonathan Comeau
Trikeb
Trikeb
Comments
I've tried replacing my schema mapping object by a table mapping object like this:
database = New RedGate.SQLCompare.Engine.Database
database.RegisterForDataCompare(New RedGate.SQLCompare.Engine.ConnectionProperties(serverName, databaseName, "sa", "enteractives.ca"), Options.Default)
Dim mappings As New TableMappings
mappings.CreateMappings(database.Tables, Nothing)
With the same result. The RegisterForDataCompare() executes without problems but the CreateMappings() method raises the same exeption.
I guess my answer can be found here: http://www.red-gate.com/messageboard/vi ... php?t=5438
I'm currently evaluating the SQLToolkit v6... when can I expect this functionality to be implemented?
If it is only available in v5 of the Toolkit, how can I obtain a copy of it?
Trikeb