Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Exemplo sobre como ler, alterar e retornar variáveis usando o componente Script Task num SSIS */
- using System;
- using System.Data;
- using Microsoft.SqlServer.Dts.Runtime;
- using System.Windows.Forms;
- namespace ST_c82cf79963ff44c7bae239e77704543a.csproj {
- [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
- public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase {
- #region VSTA generated code
- enum ScriptResults
- {
- Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
- Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
- };
- #endregion
- // USER CODE
- // global vars: ssis_variable; String or Object
- // box: readWriteVariable: User::ssis_variable
- public void Main() {
- // set global ssis variable: ssis_variable
- Dts.Variables["User::ssis_variable"].Value = "hello world";
- // get global ssis variable: ssis_variable
- string the_aux_var = Dts.Variables["User::ssis_variable"].Value.ToString();
- // message box to "see" the result
- MessageBox.Show(the_aux_var);
- // TODO: Add your code here
- Dts.TaskResult = (int)ScriptResults.Success;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement