Red Gate forums :: View topic - Scripting data to file...
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Toolkit Previous Versions
SQL Toolkit Previous Versions forum

Scripting data to file...

Search in SQL Toolkit Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
Trikeb



Joined: 28 Aug 2007
Posts: 9
Location: Montreal (Canada)

PostPosted: Wed Sep 05, 2007 4:56 pm    Post subject: Scripting data to file... Reply with quote

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
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6673

PostPosted: Thu Sep 06, 2007 9:51 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Trikeb



Joined: 28 Aug 2007
Posts: 9
Location: Montreal (Canada)

PostPosted: Thu Sep 06, 2007 4:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6673

PostPosted: Tue Sep 11, 2007 3:29 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
mackmak



Joined: 11 Oct 2007
Posts: 3

PostPosted: Thu Oct 11, 2007 2:50 pm    Post subject: Reply with quote

I am having the same issue. How can I have the bundle 5?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6673

PostPosted: Thu Oct 11, 2007 5:51 pm    Post subject: Reply with quote

SQL Data Compare 6 is out now. Can you try installing that and reference the components from there?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group