What are the challenges you face when working across database platforms? Take the survey
Options

Error Migrating SmartAssembly Database to SQL

redswimmerredswimmer Posts: 2
edited March 9, 2017 4:26PM in SmartAssembly
After upgrading to 6.11 I followed this procedure for Migrating your SmartAssembly Database to SQL https://documentation.red-gate.com/disp ... ase+to+SQL but get the errors shown below. When I go to view errors in SmartAssembly no builds show up. Please help.

C:Program FilesRed GateSmartAssembly 6MigrateFromMDB>MigrateDataFromMDB.exe "C:ProgramDataRed GateSmartAssemblydatabase.mdb" "MY-PCSQLEXPRESS"
Starting transfer of table Builds
100 rows copied so far to database Builds
200 rows copied so far to database Builds
300 rows copied so far to database Builds
400 rows copied so far to database Builds
500 rows copied so far to database Builds
600 rows copied so far to database Builds
700 rows copied so far to database Builds
800 rows copied so far to database Builds
900 rows copied so far to database Builds
1000 rows copied so far to database Builds
1100 rows copied so far to database Builds
1200 rows copied so far to database Builds
1300 rows copied so far to database Builds
1400 rows copied so far to database Builds
1500 rows copied so far to database Builds
1600 rows copied so far to database Builds
1700 rows copied so far to database Builds
1800 rows copied so far to database Builds
1900 rows copied so far to database Builds
2000 rows copied so far to database Builds
2100 rows copied so far to database Builds
2200 rows copied so far to database Builds
2300 rows copied so far to database Builds
2400 rows copied so far to database Builds
2500 rows copied so far to database Builds
2600 rows copied so far to database Builds
2700 rows copied so far to database Builds
2800 rows copied so far to database Builds
2900 rows copied so far to database Builds
3000 rows copied so far to database Builds

Unhandled Exception: System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.Builds' with unique index 'BuildAssemblyIDIndex'. The duplicate key value is (3637fb15-3600-48b9-aa8e-09953532fe33).
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlBulkCopy.RunParser(BulkCopySimpleResultSet bulkCopyHandler)
at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinuedOnSuccess(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsync(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSource`1 source)
at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource`1 source)
at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(CancellationToken ctoken)
at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 columnCount, CancellationToken ctoken)
at System.Data.SqlClient.SqlBulkCopy.WriteToServer(DataTable table, DataRowState rowState)
at MigrateDataFromMDB.Program.CopyData(OleDbConnection accessConnection, SqlConnection sqlConnection, SqlTransaction trans, String commandString, String destination)
at MigrateDataFromMDB.Program.Main(String[] args)
Tagged:

Comments

  • Options
    Jessica RJessica R Posts: 1,319 Rose Gold 4
    Thanks for your post and so sorry to hear you're running into an issue!

    Hm, it looks like the Redgate database on your SQL Server may already have data in it.

    Just to confirm--if you take a look at the Redgate database in your SQLExpress instance, does the Builds table already have entries in it? If so, can you please delete the Redgate database, restart SmartAssembly to regenerate it, and then try running the MigrateDataFromMDB.exe tool again?

    Should that not help/apply though, there may be an issue with the data in the mdb file - please let me know if the above helps or not!

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • Options
    zoltanzoltan Posts: 2 New member
    Hello

    I have a similar problem after updating from version 6.9.0.114 to version 6.11.1.363 gets the error:

    i call MigrateDataFromMDB.exe:
    C:\Program Files\Red Gate\SmartAssembly 6\MigrateFromMDB>MigrateDataFromMDB.exe "C:\ProgramData\Red Gate\SmartAssembly\database.mdb" ".\SQLEXPRESS"

    Log and exception:
    97300 rows copied so far to database Names
    97400 rows copied so far to database Names
    97500 rows copied so far to database Names
    97600 rows copied so far to database Names
    97700 rows copied so far to database Names
    97800 rows copied so far to database Names
    97900 rows copied so far to database Names
    98000 rows copied so far to database Names
    98100 rows copied so far to database Names
    98200 rows copied so far to database Names
    98300 rows copied so far to database Names
    98400 rows copied so far to database Names
    98500 rows copied so far to database Names
    98600 rows copied so far to database Names
    98700 rows copied so far to database Names
    98800 rows copied so far to database Names

    Unbehandelte Ausnahme: System.Data.SqlClient.SqlException: Verletzung der PRIMAR
    Y KEY-Einschränkung 'NamePrimaryKey'. Ein doppelter Schlüssel kann in das dbo.Na
    mes-Objekt nicht eingefügt werden. Der doppelte Schlüsselwert ist (1).
    Die Anweisung wurde beendet.
    bei System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boole
    an breakConnection, Action`1 wrapCloseInAction)
    bei System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exceptio
    n, Boolean breakConnection, Action`1 wrapCloseInAction)
    bei System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateOb
    ject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
    bei System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlComman
    d cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,
    TdsParserStateObject stateObj, Boolean& dataReady)
    bei System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand c
    mdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, Td
    sParserStateObject stateObj)
    bei System.Data.SqlClient.SqlBulkCopy.RunParser(BulkCopySimpleResultSet bulkC
    opyHandler)
    bei System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinuedOnSuccess(Bulk
    CopySimpleResultSet internalResults, String updateBulkCommandText, CancellationT
    oken cts, TaskCompletionSource`1 source)
    bei System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpl
    eResultSet internalResults, String updateBulkCommandText, CancellationToken cts,
    TaskCompletionSource`1 source)
    bei System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsync(BulkCopySimpleResultSe
    t internalResults, String updateBulkCommandText, CancellationToken cts, TaskComp
    letionSource`1 source)
    bei System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync
    (BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionS
    ource`1 source)
    bei System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(Cancella
    tionToken cts, TaskCompletionSource`1 source)
    bei System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(Cancellation
    Token ctoken)
    bei System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 colum
    nCount, CancellationToken ctoken)
    bei System.Data.SqlClient.SqlBulkCopy.WriteToServer(DataTable table, DataRowS
    tate rowState)
    bei MigrateDataFromMDB.Program.CopyData(OleDbConnection accessConnection, Sql
    Connection sqlConnection, SqlTransaction trans, String commandString, String des
    tination)
    bei MigrateDataFromMDB.Program.Main(String[] args)

    I don't have any data in the database...
    BR
  • Options
    Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi @zoltan,

    So sorry to hear that!

    Can I please check--do you use SmartAssembly's "Decode stack trace" feature as described here?

    That feature uses the "Names" table in the SmartAssembly database to decode the stack traces you enter into it.

    It sounds like the Names table in your mdb database may have invalid or duplicate data though so that it's failing to insert the data into the SQL database. If you don't use the "Decode stack trace" feature, you could just delete the rows from the Names table to get past this (the password to open the database.mdb file is 7f465a1c156d4d57 --please do make a backup of the mdb file first though if you do go ahead with this).

    If you do frequently use the Decode Stack Trace feature though, then I'd like to take a look at the mdb database. I'll set up a link where you can upload it to if so--please let me know!

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Sign In or Register to comment.