Red Gate forums :: View topic - SqlProvider -> GetMigrationSQL throw NullReferenceException
Return to RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK 10
SQL Comparison SDK 10 forum

SqlProvider -> GetMigrationSQL throw NullReferenceException

Search in SQL Comparison SDK 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message

Joined: 17 Jul 2012
Posts: 1

PostPosted: Tue Jul 17, 2012 5:42 pm    Post subject: SqlProvider -> GetMigrationSQL throw NullReferenceException Reply with quote


I am new with SQL DATA Compare SDK 10. I am currently experencing this null exception during the call to SqlProvider/GetMigrationSQL. Here's the code excerpt,

Dim provider As SqlProvider
Dim block As ExecutionBlock
Dim str As String
provider = New SqlProvider()
'run the SQL on destination DB server
block = provider.GetMigrationSQL(session, True)
Catch ex As Exception
str = ex.ToString
End Try

The details of exception looks like that,

System.NullReferenceException: Object reference not set to an instance of an object. at #8ZK.#j2K.#kOW(#x1K #Zds, ComparisonSession #RlYb, Boolean #hkl) at RedGate.SQLDataCompare.Engine.SqlProvider.#CbL(ComparisonSession #RlYb, Boolean #hkl) at RedGate.SQLDataCompare.Engine.SqlProvider.#DbL(ComparisonSession #RlYb, SelectionDelegate #UKPb, Boolean #hkl) at RedGate.SQLDataCompare.Engine.SqlProvider.GetMigrationSQL(ComparisonSession session, SelectionDelegate select, Boolean runOnTwo) at Thomas.MultiLang.DBSynchronizer.SyncDBData() in C:\Projects\Thomas\Flex\Thomas.Server\Thomas.MultiLang\Manager\DBSynchronizer.vb:line 165"

Throught my online search, I got some sense that about two database tables schema may be different. So i used Redgate Sql compare Tool to compare the two DB and the result was that the two DB were identical.

Could you tell me where went wrong?


Back to top
View user's profile Send private message
Brian Donahue

Joined: 23 Aug 2004
Posts: 6677

PostPosted: Wed Jul 18, 2012 1:40 pm    Post subject: Reply with quote

Hi Susan,

It looks like you have to build a list of differences (using the CompareDatabases method) before you can use this method. Please see:
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