| Author |
Message |
Trikeb
Joined: 28 Aug 2007 Posts: 9 Location: Montreal (Canada)
|
Posted: Wed Sep 05, 2007 4:56 pm Post subject: Scripting data to file... |
|
|
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, |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Thu Sep 06, 2007 9:51 am Post subject: |
|
|
Off the top of my head, I'd say this happened because CreateMappings will only accept a collection of tables or views as arguments, ie mappings.CreateMappings(database.Tables, Nothing). The particular overload that appears in the error message isn't documented in the Toolkit help, though. It must be a private method? _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
Trikeb
Joined: 28 Aug 2007 Posts: 9 Location: Montreal (Canada)
|
Posted: Thu Sep 06, 2007 4:26 pm Post subject: |
|
|
Hi Brian,
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/viewtopic.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? |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Tue Sep 11, 2007 3:29 pm Post subject: |
|
|
Sorry, I didn't realize that you couldn't mix the SQL Compare Engine from version 6 and the data compare engine from version 5. SQL Data Compare 6 will be released next month (which should solve the issue), but in the meantime, I'll private message you with the likk to SQL Bundle 5. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
mackmak
Joined: 11 Oct 2007 Posts: 3
|
Posted: Thu Oct 11, 2007 2:50 pm Post subject: |
|
|
| I am having the same issue. How can I have the bundle 5? |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Thu Oct 11, 2007 5:51 pm Post subject: |
|
|
SQL Data Compare 6 is out now. Can you try installing that and reference the components from there? _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|