VB.Net code in SSIS 2008
Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Runtime Imports System.IO.FileStream Imports System.IO Public Sub Main() Dim vFileName As String = "c:\xyz.txt" 'Get a StreamReader class that can be used to read the file Dim objStreamReader As StreamReader objStreamReader = File.OpenText(vFileName) 'Now, read the entire file into a string Dim nodata_contents As String = objStreamReader.ReadLine 'Set the text of the file to a Web control If nodata_contents.Substring(0, 6).ToUpper = "NODATA" Then Dts.Variables.Item("gsDataFlag").Value = "NO" Else Dts.Variables.Item("gsDataFlag").Value = "YES" End If Dts.TaskResult = ScriptResults.Success End Sub End Classsql
February 22nd, 2012 11:02pm

So, What is the question?!?!?!? this code open the xyz.txt file and check if the first line contains "NODATA" string then set the gsDataFlag variable with NO, otherwise YES http://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2012 11:17pm

So, What is the question?!?!?!? this code open the xyz.txt file and check if the first line contains "NODATA" string then set the gsDataFlag variable with NO, otherwise YES http://www.rad.pasfu.com
February 23rd, 2012 7:10am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics