BulkInsertTask.Validate 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
驗證已正確設定「大量插入」工作元件。
public:
override Microsoft::SqlServer::Dts::Runtime::DTSExecResult Validate(Microsoft::SqlServer::Dts::Runtime::Connections ^ connections, Microsoft::SqlServer::Dts::Runtime::VariableDispenser ^ variableDispenser, Microsoft::SqlServer::Dts::Runtime::IDTSComponentEvents ^ events, Microsoft::SqlServer::Dts::Runtime::IDTSLogging ^ log);
public override Microsoft.SqlServer.Dts.Runtime.DTSExecResult Validate (Microsoft.SqlServer.Dts.Runtime.Connections connections, Microsoft.SqlServer.Dts.Runtime.VariableDispenser variableDispenser, Microsoft.SqlServer.Dts.Runtime.IDTSComponentEvents events, Microsoft.SqlServer.Dts.Runtime.IDTSLogging log);
override this.Validate : Microsoft.SqlServer.Dts.Runtime.Connections * Microsoft.SqlServer.Dts.Runtime.VariableDispenser * Microsoft.SqlServer.Dts.Runtime.IDTSComponentEvents * Microsoft.SqlServer.Dts.Runtime.IDTSLogging -> Microsoft.SqlServer.Dts.Runtime.DTSExecResult
Public Overrides Function Validate (connections As Connections, variableDispenser As VariableDispenser, events As IDTSComponentEvents, log As IDTSLogging) As DTSExecResult
參數
- connections
- Connections
工作所使用之連接的集合。
- variableDispenser
- VariableDispenser
用於鎖定變數的 VariableDispenser 物件。
- events
- IDTSComponentEvents
實作 IDTSComponentEvents 介面的物件。
- log
- IDTSLogging
實作 IDTSLogging 介面的物件。
傳回
DTSExecResult 列舉中的值。
範例
下列程式碼範例示範如何使用物件的方法來驗證物件 Validate Package 。
DTSExecResult myresult = pkg.Validate(myPkgConnections, myPkgVariables, myIDTSEvents, myIDTSLogging);
Dim myresult As DTSExecResult = pkg.Validate(myPkgConnections,myPkgVariables,myIDTSEvents, myIDTSLogging)
備註
Validate方法會審核屬性和設定是否有不正確或不正確的設定。 方法不會觸控資料,也不會連接到資料來源來驗證連接。 但是,它可確保填入必要欄位,並包含適當的值。 經過驗證的欄位會因正在驗證的物件而有所不同。
的主要用途 Validate 是在撰寫自訂工作時。 當 Validate 設定屬性時,SSIS 設計工具會呼叫此方法,而當工作卸載至設計介面上時,它可能會多次。 但是在程式碼中, Validate 不常使用個別物件上的方法,因為建議您在 Validate Package 需要驗證物件時,在上呼叫方法。 但是,如果您在需要的情況下找出獨特的情況,就可以在個別物件上使用方法。
Validate方法會在自訂工作中覆寫,以在 SSIS 設計工具中使用時或由程式碼呼叫時,用於驗證物件。 如需撰寫自訂工作之方法的詳細資訊 Validate ,請參閱撰寫 自訂工作的程式碼。