microsoft / microsoft/sqlmanagementobjects
Error While Transfering System Versioned Temporal Tables
まだ誰も着手していません。
- 主要言語
- C#
- スター
- 143
- フォーク
- 28
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
報告された SMO.Transfer 構成から開始し、システム バージョン管理されたテンポラル テーブルとカスタムのテーブル/ビュー選択を使用して失敗を再現します。SqlBulkCopy によって報告されたソース列と宛先列のマッピングを比較します。ColumnMapping 例外が発生せずに転送が完了すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp, sql
- 領域
- databases
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100