microsoft / microsoft/sqlmanagementobjects

Error While Transfering System Versioned Temporal Tables

Ouverte
#160 5 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
C#
Étoiles
143
Forks
28
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hello,

While doing a direct database Transfer using the SMO.Transfer Object, I get this error at the System Versioned Temporal Tables:

Unhandled exception. Microsoft.SqlServer.Management.Common.TransferException: An error occurred while transferring data. See the inner exception for details. ---> System.InvalidOperationException: The given ColumnMapping does not match up with any column in the source or destination. at Microsoft.Data.SqlClient.SqlBulkCopy.AnalyzeTargetAndCreateUpdateBulkCommand(BulkCopySimpleResultSet internalResults) at Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSource1 source)
at Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource1 source) at Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(CancellationToken ctoken) at Microsoft.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 columnCount, CancellationToken ctoken) at Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(DbDataReader reader) at Microsoft.SqlServer.Management.Smo.Transfer.SqlBulkCopyData(SqlConnection sourceConnection, SqlConnection destinationConnection, TransferWriter writer, SqlTransaction transaction) at Microsoft.SqlServer.Management.Smo.Transfer.TransferData() --- End of inner exception stack trace --- at Microsoft.SqlServer.Management.Smo.Transfer.TransferData()

I am hoping that there is a flag that I need to turn on or that because I turned off a setting this has happened. Here is my current setup for my Transfer object:

`var transfer = new Transfer(sourceDB);

        transfer.CopyAllObjects = false;
        transfer.CopyData = true;
        transfer.CopyAllTables = false;
        transfer.CopyAllViews = false;

        
        transfer.CopyAllStoredProcedures = false;
        transfer.CopyAllUserDefinedFunctions = false;
        transfer.PrefetchObjects = true;

        transfer.Options.WithDependencies = true;
        transfer.Options.ContinueScriptingOnError = true;
        transfer.Options.IncludeIfNotExists = true;
        transfer.Options.AllowSystemObjects = false;
        transfer.Options.Indexes = true;
        transfer.Options.ClusteredIndexes = true;
        transfer.Options.NonClusteredIndexes = true;
        transfer.Options.DriAll = true; 
        transfer.Options.ChangeTracking = true;
        transfer.Options.EnforceScriptingOptions = false;

        transfer.Options.Bindings = true;
        transfer.Options.IncludeHeaders = true;
        transfer.Options.ClusteredIndexes = true;
        transfer.Options.ExtendedProperties = true;
        transfer.Options.AllowSystemObjects = true;
        transfer.Options.Permissions = false;
        transfer.DestinationDatabase = destinationDBName;
        transfer.DestinationServer = destinationSQLInstanceName;
        transfer.DestinationPassword = destinationSQLPassword;
        transfer.DestinationLogin = destinationSQLUser;
        transfer.DestinationLoginSecure = false;

`

With a custom list of tables and Views.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez avec la configuration SMO.Transfer signalée et reproduisez l’échec à l’aide d’une table temporelle avec versionnement système et de la sélection personnalisée de table/vue. Comparez les mappages de colonnes source et destination signalés par SqlBulkCopy ; c’est terminé lorsque le transfert s’effectue sans l’exception ColumnMapping.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
csharp, sql
Domaine
databases
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.