Quantcast
Channel: SQL Server Integration Services forum
Viewing all 24688 articles
Browse latest View live

Read gif file and rename file with customer number

$
0
0

In DFT data set I have cust number and weight.(i.e. output of another task not in database) In one folder I do have number of gif files (gif file name with weight). As per the weight I need to choose gif file for customer and copy the gif file and store it in another folder with customer number. Please guide me how to do this?


Check if Record Exists between OLEDBSource and OLEDBDestination inside a DataFlow Task

$
0
0

Hello,

I have a Storedprocedure in a RemoteServer (Server2) which will return a result of a select statement and the result need to be stored inside a table of Server 1. 

So I have used a DataFlow task to do the same where I have a OLEDB Source that execute the Sproc on Server 2 and OLEDB Destination that loads the result on a table of Server 1. This is working good.

Now I want a check in between to see if the sproc returns any row then I will:
1) Truncate the Table on Server 1 (Destination)
2) Then Load the rows.

Else it should skip truncate and load operation.

Please advise.

SSIS 2008 Connection ?

$
0
0

Hello:

I need help on creating ODBC connection.

The ODBC that i have is of 3rd party and i want to use that 3rd party ODBC to create new connection in my SSIS pkg which will be my destination.

From Start-----> Admin Tool------> Data Source (ODBC), i am seeing that 3rd party ODBC. In that i created user DSN & system DSN and both are connecting and working.

But in SSIS, when i create new connection i am not able to see that 3rd party ODBC nor i am able to see the DSN that i created.

Is it i am missing something over here or i am not doing correctly.

Any help is greatly appreciated. Thanking in advance.

Thanks

Regards

multiple delimeters in a Flat file in ssis problem in ssis

$
0
0

Hi,

I have a flat file source which contains comm separated ,semicolan separated and tab separated flat file source

and i want output like below

by  using ssis how it is possible


Sharma.c

[Flat File Source [2]] Error: Cannot open the datafile "VendorPurchases20050512.txt".

$
0
0

hi

I'm trying to use foreachloop container in order to read the data that i have in several txt files and upload it into MRR table. 

when i'm trying to run the package, i'm getting the following error: 

[Flat File Source [2]] Warning: The system cannot find the file specified.
[Flat File Source [2]] Error: Cannot open the datafile "VendorPurchases20050512.txt".
[SSIS.Pipeline] Error: Flat File Source failed the pre-execute phase and returned error code 0xC020200E.

I don't know what's the problem since it was working before.In the flat file connection manager i defined all the path including the name of the file.

I'll be happy for assistance

thanks

Yaron

SSRS

$
0
0

Hi all,

How to calculate Distance from longitude and latitude in sql server


Sharma.c

Excel Data Source data type conversion error

$
0
0

I hoping someone can help me with this. I am unable to get an excel data source to work properly. I am getting an error saying that the source cannot convert between Unicode and non-Unicode string types. I have attempted to set the format of external and output columns in the input and output properties of the advanced editor to both be the data [DT_STR] type, but the data type of the external column keeps reverting back to Unicode string [DT_WSTR] as soon as I exit the advanced editor.

I am running the project in 32 bit mode.

What is the trick I am missing?

Stuck with Pivot Transformation - cannot be mapped to PivotKey input column error

$
0
0

Hi, I'm stuck with the Pivot Transformation and would appreciate if anyone can point me in the right direction.

I've got 4 incoming columns:

RetailerLineIDRetailerTariff DescriptionTariff Value
1Retailer ALevy0.0021
1Retailer ADiscount0.12
1Retailer AFixed daily charge1.4548
1Retailer AUncontrolled0.337

which I would like to display as follow:

RetailerLineIDRetailerLevyDiscountFixed daily chargeUncontrolled
1Retailer A0.00210.121.45480.337

I've setup my Pivot Transformation as follow:

RetailerLineID PivotUsage as 0

Retailer PivotUsage as 1

TariffDescription PivotUsage as 2

TariffValue PivotUsage as 3

I've defined the following output columns:

RetailerLineID

Retailer

Levy -  PivotKeyValue = Levy, SourceColumn = LinageID of Input Tariff Description

Discount - PivotKeyValue = Discount, SourceColumn = LinageID of Input Tariff Description

Fixed daily charge - PivotKeyValue = Fixed daily charge, SourceColumn = LinageID of Input Tariff Description

Uncontrolled - PivotKeyValue = Uncontrolled, SourceColumn = LinageID of Input Tariff Description

But I get the error message:

Error at Data Flow Task [Pivot [150]]: Output column "Levy" (369) cannot be mapped to PivotKey input column.

What am I doing wrong? Seems like there is nothing I can do to get rid of this error and as far as I know my configuration is correct. Have a missed anything?


2k8R2: Script transform source catching unrelated errors.

$
0
0

Hi all,

I've inherited a package that uses a script transform source in a data flow to parse a complex text file.

I've noticed that any error in the data flow is caught by the source (ie pkey violations in the oledb destination) and I get a script component:runtime error Script component has encountered an exception in user code:

the script is:

/* Microsoft SQL Server Integration Services Script Component
*  Write scripts using Microsoft Visual C# 2008.
*  ScriptMain is the entry point class of the script.*/
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
/// <summary>
/// Provides a data source based on a GRID file.
/// </summary>
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
    #region Properties
    /// <summary>
    /// Gets the path to the file to be used as a data source.
    /// </summary>
    private string SourceFilePath { get { return Variables.CurrentLocalDownloadFilePathExtracted; } }
    #endregion
    #region Methods
    /// <summary>
    /// Creates rows and adds them to the output buffer(s).
    /// </summary>
    public override void CreateNewOutputRows()
    {
        const string VALID_DATA_CHARS = " .1234567890";
        try
        {
            int ncols = 0;
            int nrows = 0;
            decimal xllcorner = 0.0M;
            decimal xllcenter = 0.0M;
            decimal yllcorner = 0.0M;
            decimal yllcenter = 0.0M;
            decimal cellsize = 0.0M;
            decimal nodata = 0.0M;
            decimal longitude = 0.0M;
            decimal latitude = 0.0M;
            string line;
            int counter = 0;
            // Read the file and process it line by line.
            using (System.IO.StreamReader file = new System.IO.StreamReader(this.SourceFilePath))
            {
                while ((line = file.ReadLine()) != null)
                {
                    counter++;
                    switch (counter)
                    {
                        // First 6 rows are "header" info, then the rest contains the "real data".
                        case 1:
                            if (line.ToLower().StartsWith("ncols"))
                            {
                                ncols = Int32.Parse(line.Substring(5));
                            }
                            else
                            {
                                throw new System.IO.InvalidDataException("File Error: " + this.SourceFilePath + ", row: " + counter.ToString() + "\nData in error:\n" + line);
                            }
                            break;
                        case 2:
                            if (line.ToLower().StartsWith("nrows"))
                            {
                                nrows = Int32.Parse(line.Substring(5));
                            }
                            else
                            {
                                throw new System.IO.InvalidDataException("File Error: " + this.SourceFilePath + ", row: " + counter.ToString() + "\nData in error:\n" + line);
                            }
                            break;
                        case 3:
                            if (line.ToLower().StartsWith("xll"))
                            {
                                if (line.ToLower().StartsWith("xllcorner"))
                                {
                                    xllcorner = Decimal.Parse(line.Substring(9));
                                }
                                else
                                {
                                    xllcenter = Decimal.Parse(line.Substring(9));
                                }
                            }
                            else
                            {
                                throw new System.IO.InvalidDataException("File Error: " + this.SourceFilePath + ", row: " + counter.ToString() + "\nData in error:\n" + line);
                            }
                            break;
                        case 4:
                            if (line.ToLower().StartsWith("yll"))
                            {
                                if (line.ToLower().StartsWith("yllcorner"))
                                {
                                    yllcorner = Decimal.Parse(line.Substring(9));
                                }
                                else
                                {
                                    yllcenter = Decimal.Parse(line.Substring(9));
                                }
                            }
                            else
                            {
                                throw new System.IO.InvalidDataException("File Error: " + this.SourceFilePath + ", row: " + counter.ToString() + "\nData in error:\n" + line);
                            }
                            break;
                        case 5:
                            if (line.ToLower().StartsWith("cellsize"))
                            {
                                cellsize = Decimal.Parse(line.Substring(8));
                                // now we have all the header info we need - work out our starting latitude and longitude
                                if (xllcenter == 0.0M && xllcorner > 0.0M)
                                {
                                    xllcenter = xllcorner + (cellsize / 2.0M);
                                    yllcenter = yllcorner + (cellsize / 2.0M);
                                }
                                longitude = xllcenter;
                                latitude = yllcenter + ((nrows - 1) * cellsize);
                            }
                            else
                            {
                                throw new System.IO.InvalidDataException("File Error: " + this.SourceFilePath + ", row: " + counter.ToString() + "\nData in error:\n" + line);
                            }
                            break;
                        case 6:
                            if (line.ToLower().StartsWith("nodata"))
                            {
                                nodata = Decimal.Parse(line.Substring(12));
                            }
                            else
                            {
                                throw new System.IO.InvalidDataException("File Error: " + this.SourceFilePath + ", row: " + counter.ToString() + "\nData in error:\n" + line);
                            }
                            break;
                        default:
                            if (counter <= (nrows + 6) && VALID_DATA_CHARS.Contains(line[0].ToString()))
                            {
                                this.ProcessLine(line.Trim(), longitude, latitude, cellsize);
                                latitude = latitude - cellsize;
                            }
                            else if (counter <= (nrows + 6))
                            {
                                throw new System.IO.InvalidDataException("File Error: " + this.SourceFilePath + ", row: " + counter.ToString() + "\nData in error:\n" + line);
                            }
                            break;
                    }
                }
            }
        }
        catch
        {
            throw;
        }
    }
    /// <summary>
    /// Processes an individual line of .grid file data
    /// </summary>
    /// <param name="line">Line of data values</param>
    /// <param name="longitude">Starting longitude for the line of data</param>
    /// <param name="latitude">Starting latitude for the line of data</param>
    /// <param name="cellSize">The longitude "step size" for each column in the data</param>
    private void ProcessLine(string line, decimal longitude, decimal latitude, decimal cellSize)
    {
        string[] dataValues = line.Split(new char[] { ' ' });
        foreach (string dataValue in dataValues)
        {
            decimal actualValue = 0.0M;
            try
            {
                actualValue = Decimal.Parse(dataValue, System.Globalization.NumberStyles.Any);
            }
            catch (System.OverflowException ex)
            {
                // ignore - the overflows are "too small", not "too big" - writes a zero to the database.
            }
            actualValue = decimal.Round(actualValue, 3);
            this.AddRowToOutputBuffer(longitude, latitude, actualValue);
            longitude += cellSize;
        }
    }
    /// <summary>
    /// Adds a new row to the SSIS output buffer based on the data provided.
    /// </summary>
    /// <param name="longitude"></param>
    /// <param name="latitude"></param>
    /// <param name="actualValue"></param>
    private void AddRowToOutputBuffer(decimal longitude, decimal latitude, decimal actualValue)
    {
        GridFileOutputBuffer.AddRow();
        GridFileOutputBuffer.Longitude = longitude;
        GridFileOutputBuffer.Latitude = latitude;
        GridFileOutputBuffer.ActualValue = actualValue;
    }
    #region Unused
    public override void PreExecute()
    {
        base.PreExecute();
        /*
          Add your code here for preprocessing or remove if not needed
        */
    }
    public override void PostExecute()
    {
        base.PostExecute();
        /*
          Add your code here for postprocessing or remove if not needed
          You can set read/write variables here, for example:
          Variables.MyIntVar = 100
        */
    }
    #endregion
    #endregion
}

Is there a quick fix or will I need to rewrite it to use Me.ComponentMetaData.FireError?


Adelaide, Australia

Error while using SSIS package to transfer data from On premise SQL Server 2008 R2 to Windows Azure Database

$
0
0

Hi, 
I am using SSIS package to transfer data in a table from on premise SQL Server 2008 R2 to Windows Azure database using Data Flow Task

For testing purpose, I selected one row using ADO.NET source, used Script Task to modify value in one column of the table and sent it to ADO.NET Destination.

I am able to see that row in the Windows Azure Database table. 

However, when I ran the SSIS package for the whole table (table has around 1 lakh rows or even more), I got this error

SSIS package "C:\Users\xyz\documents\visual studio 2010\Projects\SSISScript\SSISScript\Package1.dtsx" starting.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Warning: 0x80049304 at Data Flow Task, SSIS.Pipeline: Warning: Could not open global shared memory to communicate with performance DLL; data flow performance counters are not available.  To resolve, run this package as an administrator, or on the system's console.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Error: 0xC020844B at Data Flow Task, ADO NET Destination [2]: An exception has occurred during data insertion, the message returned from the provider is: Cannot access destination table '"dbo"."xyz"'.
Error: 0xC0047022 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "ADO NET Destination" (2) failed with error code 0xC020844B while processing input "ADO NET Destination Input" (9). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.
Error: 0xC02090F5 at Data Flow Task, ADO NET Source [33]: The ADO NET Source was unable to process the data. Exception from HRESULT: 0xC0047020
Error: 0xC0047038 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on ADO NET Source returned error code 0xC02090F5.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
The program '[7564] DtsDebugHost.exe: DTS' has exited with code 0 (0x0).

Has anyone faced the same error before?

ERROR [HYT00] Timeout expired On SSIS Package Execution

$
0
0

Hi,

We Develope one .dtsx package in SSIS 2008 to Extract Data from IBM NETEZZA Database.. For this we are using "netezzaoled" and "netezzaodbc" 64 bit drivers for this. we created connection with source by using both odbc and oledb driver.In package we are using ADO.NET source and ADO.NET Destination and put some simple query have some 4-5 columns.

But when i execute the same package it throw some error given below on regular basis like on 20 execution 5 time it's throw error.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

[ADO NET Source [1]] Error: System.Data.Odbc.OdbcException: ERROR [HYT00] Timeout expired
   at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
   at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)
   at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader)
   at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Odbc.OdbcCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.PreExecute()
   at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPreExecute(IDTSManagedComponentWrapper100 wrapper)

[SSIS.Pipeline] Error: component "ADO NET Source" (1) failed the pre-execute phase and returned error code 0x80131937.
-----------------------------------------------------------------------------------------------******-----------------------------------------------

ERROR [HYT00] Timeout expired(nsqlodbc.dll)

Can anybody please help me out to resolve this issue.

Thanks,

Neeraj Bhartiya

how u can do audit information with less no of statements?

$
0
0

Hi,

how u can do audit information in ssis with less no of statements with out using audit transformation?

Thanks & regards

Kiran

my source table is frequent updating who can i extract data in to ssis?

$
0
0

Hi,

my source table is frequent updating who can i extract data in to ssis?

what are the steps i need to fallow?

Thanks & Regards

Kiran.

how to load data into parent child package in Target?

$
0
0

Hi,

while loading package... in my target has two tables with paret child relation ,child record is there but no related record in parent?

In this situation how can i load the data into my target?With out disabling constraints in my target table?

Thanks&Regards

Kiran

Child Package Variable to Parent Package Variable

$
0
0

Hi,

I want to access child package variable's  to parent package and update the parent package variable's and pass that to remaining child package's

Is it possible if yes what is the best suggestion u can give to access the variables



Thanks in advance.


SSIS 2012 Project level connection manager and parameters

$
0
0
I have an OLE DB connection manager at the project level (in order to avoid having 12 different objects connecting to the same data source, one in each package). My goal is to have parameters for parts of the connection string, such as the server and database names, because I won't know the values for those items. When I place the expression on the connection manager for the connection string ("Data Source=" + @[$Project::ServerName] + ";User ID=" + @[$Project::UserName]  +";Initial Catalog=" + @[$Project::InitialCatalog]; + "Provider=SQLNCLI11.1;Persist Security Info=True;") the components in the package which use the connection all give errors which say "The connection string format is not valid. It must consist of one or more components of the form X=Y, separated by semicolons. This error occurs when a connection string with zero components is set on database connection manager." I am wondering if it is possible or advisable to attempt this or do I still have to the same connections in each package (package level connection managers). It seems as if this would be an example of why the project level connection managers exist. Thank you.

how to Unzip the zipped files using SSIS .

$
0
0

Hi All

 how to Unzip the zipped files using SSIS .  File.gz extension files we are getting . How to Unzip it .


Surendra Thota

How monitoring the mail sending by Send Mail task - SSIS 2012

$
0
0

Hi,

in a my SSIS 2012 pkg I've put a send mail specifying the smtp server, the recipient (my mail address), the subject and so on. The task is executed successfully, but I haven't received any mails.

How can I monitor the send mail task execution?

Thanks

Alterate for Update in ssis

$
0
0
I'm updatin the table based on condition in other table.Initailly it is created in script companent the same update script.
It is taking approximately 30 mts for 10000 Record.Now we have 1.2 million it means it will take 5 days ...it doesn't make sense better to do it manually.
What is the alternate for this scenario ?

Update & Insert in SSIS 2008 R2

$
0
0

Hi All,

I am new to SSIS, Please look at the below simple requirement and suggest me best way to do that.

How to update and insert the data from source to destination?

Both source and destinations are the sql data bases but these DB''s are exist in diffrent servers.

Source table: EMPNO(BusinessKey& INT),  EMPName(Varchar(50)),  Address(Varchar(1000))

Destination table: EMPNO(Business Key & Varchar(10)), EMPName(Varchar(50)),  Address(Varchar(Max)).

Thnaks in Advance.....

Regards,

Mandava.

Viewing all 24688 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>