DropDWStagingSnapshot
 SCR Concatenate List of DROP Snapshot Failures
  Properties
Property Value
Name SCR Concatenate List of DROP Snapshot Failures
Description Script Task
Precedence Executables none
Contrained Executables none
BreakpointManager Microsoft.SqlServer.Dts.Runtime.BreakpointManager
Breakpoints System.Collections.ArrayList
CreationName Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptTask, Microsoft.SqlServer.ScriptTask, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
DebugMode False
DelayValidation False
Disable False
DisableEventHandlers False
EntryPoint Main
ExecutionDuration 0
ExecutionResult 0
ExecutionStatus 1
ExecutionValue
FailPackageOnFailure False
FailParentOnFailure False
ForcedExecutionValue 0
ForceExecutionResult -1
ForceExecutionValue False
ID {86FDA22C-A407-46CE-BE87-C090353E1EA3}
IsDefaultLocaleID True
IsolationLevel 1048576
LocaleID English (United States)
LoggingMode 0
MaximumErrorCount 1
ReadOnlyVariables User::NameOfSnapshotToDelete
ReadWriteVariables User::SnapshotDropFailList
ScriptingEngine Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine
ScriptLanguage Microsoft Visual Basic 2008
ScriptLoaded True
ScriptProjectName ST_51f5f35ac1a34a8f986caec1df09cec8
ScriptStorage Microsoft.SqlServer.VSTAHosting.VSTAScriptProjectStorage
SuspendRequired False
TransactionOption 1
Version 0
  Source Code
'  Microsoft  SQL  Server  Integration  Services  Script  Task
'  Write  scripts  using  Microsoft  Visual  Basic  2008.
'  The  ScriptMain  is  the  entry  point  class  of  the  script.

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime

<System.AddIn.AddIn("ScriptMain", Version:="1.0", Publisher:="", Description:="")> _
<System.CLSCompliantAttribute(False)> _
Partial Public Class ScriptMain
   Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase

   Enum ScriptResults
       Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success
       Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
   End Enum
   

   '  The  execution  engine  calls  this  method  when  the  task  executes.
   '  To  access  the  object  model,  use  the  Dts  property.  Connections,  variables,  events,
   '  and  logging  features  are  available  as  members  of  the  Dts  property  as  shown  in  the  following  examples.
   '
   '  To  reference  a  variable,  call  Dts.Variables("MyCaseSensitiveVariableName").Value
   '  To  post  a  log  entry,  call  Dts.Log("This  is  my  log  text",  999,  Nothing)
   '  To  fire  an  event,  call  Dts.Events.FireInformation(99,  "test",  "hit  the  help  message",  "",  0,  True)
   '
   '  To  use  the  connections  collection  use  something  like  the  following:
   '  ConnectionManager  cm  =  Dts.Connections.Add("OLEDB")
   '  cm.ConnectionString  =  "Data  Source=localhost;Initial  Catalog=AdventureWorks;Provider=SQLNCLI10;Integrated  Security=SSPI;Auto  Translate=False;"
   '
   '  Before  returning  from  this  method,  set  the  value  of  Dts.TaskResult  to  indicate  success  or  failure.
   '  
   '  To  open  Help,  press  F1.

   Public Sub Main()
       '
       '  Add  your  code  here
        '
        Dim sFailList As String = ""
        sFailList = Dts.Variables("SnapshotDropFailList").Value.ToString

        If sFailList <> "" Then
            sFailList = sFailList & ";  "
        End If

        sFailList = sFailList & Dts.Variables("NameOfSnapshotToDelete").Value.ToString

        Dts.Variables("SnapshotDropFailList").Value = sFailList

       Dts.TaskResult = ScriptResults.Success
   End Sub

End Class
  Variables
Name Value Description
Powered by BI Documenter