Posted on June 10, 2008 by Siemen
There may be requirement to throw error from Script Task.
Here’s a way to Throw error from Script Task.
//Code Starts Here
Try
‘method which throws an error
Catch e
Me.ComponentMetadata.FireError(-1, “”, “Your Error Message: ” + e.Message, “”, true)
While Not e.InnerException Is Nothing
[...]
Filed under: SSIS, integration services | Tagged: error from script task, error handling, script task error, script task fireerror, ssis error handling, trow error from script task | Leave a Comment »
Posted on June 5, 2008 by Siemen
This post will show you how to log from the script task.
While logging from inbuilt log system this method helps you to log the exact details of the event in the script task.
using System;
using System.Data;
using System.Math;
using Microsoft.SqlServer.Dts.Runtime;
public class ScriptMain
{
public void Main()
{
[...]
Filed under: SSIS, integration services | Tagged: integration services log, logging ssis, script task, script task log, ssis log | Leave a Comment »
Posted on June 4, 2008 by Siemen
Here i will show how to send SMTP email from a script task rather than the SMTP Mail Task.
Imports System
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Net.Mail
Imports System.Net
Public Class ScriptMain
Public Sub Main()
Dim myHtmlMessage As MailMessage
Dim mySmtpClient As SmtpClient
myHtmlMessage=New MailMessage(name@helpindotnet.blogspot.com,
[...]
Filed under: SSIS, integration services | Tagged: email script task, integration services, integration services email, integration services send email, send email from scrit task, send mail from ssis, send mail task, SSIS, ssis email, ssis send mail | 2 Comments »
Posted on June 2, 2008 by Siemen
Create a function in MSSQL to remove all special characters from XML.
ALTER FUNCTION [dbo].[RemoveSpChar]
(
– Add the parameters for the function here
@sInput varchar(MAX)=”
)
RETURNS varchar(MAX)
AS
BEGIN
– Declare the return variable here
DECLARE @sOutput Varchar(MAX),
@iIndex int,
@iLength int,
@sChar varchar(1),
@iASCII int,
@iLen int,
@iRem int
set @sInput= ltrim(rtrim(@sInput))
set @iLength = len(@sInput)
set @iIndex =1
set @sOutput=”
while @iIndex <= @iLength
begin
set @sChar=substring(@sInput,@iIndex,1)
set @iASCII=ascii(@sChar)
if ((@iASCII>=48 and @iASCII<=57) or (@iASCII>=65 [...]
Filed under: sql, xml | Tagged: mssql function, remove special character from xml string, sql, sql function to remove special character, xml, xml special character, xml string | Leave a Comment »