microsoft / microsoft/sqlmanagementobjects

Error While Transfering System Versioned Temporal Tables

Offen
#160 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
C#
Sterne
143
Forks
28
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der gemeldeten SMO.Transfer-Konfiguration und reproduziere den Fehler mithilfe einer systemversionierten temporalen Tabelle und der benutzerdefinierten Auswahl von Tabelle/View. Vergleiche die von SqlBulkCopy gemeldeten Spaltenzuordnungen von Quelle und Ziel; abgeschlossen ist die Aufgabe, wenn der Transfer ohne die ColumnMapping-Ausnahme abgeschlossen wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp, sql
Bereich
databases
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.