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

Connection Manager changes from Oracle client to SQL Server client causing error.

$
0
0

I have created an ETL package that copies data from Oracle tables to an Oracle table using a Data Flow task.  Then I copy data from the Oracle table to a SQL Server table using a Data Flow Task but for the OLE DB Source I am using a query against the SQL Server Right Outer Joining the Oracle table.  This was working fine until I changed the User ID and Password of the Oracle Connection Manager.  Now when I triy to run the package it errs out with a login failure.  When I checked the Oracle Connection Manager I noticed that the Provider changed from OraOLEDB.Oracle.1 to SQLNCLI10.1.  I have deleted the Oracle Connection Manager and recreated it but with the same problem.

What would cause this?

Fred


Fred


ssis truncation error

$
0
0

Hello,

I am trying to import data from csv to a sql server table (2008 R2 SE edition of sqlserver) with an ssis package. The data I am trying to import is from a website form that gets saved to a csv file. Here is the table DDL:

CREATE TABLE [dbo].[FormData](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[CreatedAt] [datetime] NULL,
	[FirstName] [nvarchar](60) NULL,
	[LastName] [nvarchar](60) NULL,
	[Title] [nvarchar](60) NULL,
	[BusinessName] [nvarchar](60) NULL,
	[TypeOfBusiness] [nvarchar](60) NULL,
	[EmailAddress] [nvarchar](60) NULL,
	[PhoneNumber] [nvarchar](24) NULL,
	[PhoneExtension] [nvarchar](20) NULL,
	[TypeOfInquiry] [nvarchar](60) NULL,
	[YourInterests] [nvarchar](4000) NULL,
 CONSTRAINT [PK_FormData] PRIMARY KEY CLUSTERED
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

ALTER TABLE [dbo].[FormData] ADD  CONSTRAINT [DF_CreateDate_GetdateValue]  DEFAULT (getdate()) FOR [CreatedAt]
GO
 

My ssis package does the inserts from csv to table without errors if all fields have values in the csv file. However if someone doesnt have a phoneextension and fill out the form and submit without entering data for this field then my ssis package fails with the following error:

[Flat File Source [1]] Error: Data conversion failed. The data conversion for column ""Phone Extension"" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".


[Flat File Source [1]] Error: The "output column ""Phone Extension"" (118)" failed because truncation occurred, and the truncation row disposition on "output column ""Phone Extension"" (118)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.

I am providing with sample data below for which the insert failed:

Createdat,First,Last,"Company Name","Type of Organization","Enter Email",Phone,"What's Your Interest?",Title,"Phone Extension"
"2016-04-12 00:51:39",Ben,Charles,"Thai Massage",Business,newoilmassage@yahoo.com,"(123) 222-4444","Want to send out general messages to massage lovers daily",,,,,

I am converting data according the column sizes in the table and they are all DT_WSTR except for date as the date uses a default constraint

Mapping is as shown:

First-->FirstName, Lasr-->LastName, companyname-->businessName,Typeoforganization-->Typeofbusiness,enteremail-->emailaddress,Phone-->phonenumber,What's Your Interest?-->yourinterests,Title-->title,"Phone Extension"-->phoneextension

A csv file with successfull insert looks like this:

Createdat,First,Last,"Company Name","Type of Organization","Enter Email",Phone,"Phone Extension","What's Your Interest?",Title
"2016-04-11 18:21:59",Adams,Chris,testdata,Business,test@test.com,"(123) 456-7890",1111,"this is just for test",,,,

How can I fix this error and let inserts run normally?

Thanks a ton


Execute Power shell script from SSIS 2012

$
0
0

Hi ,

I am using SSIS 2012 and trying to execute power shell script using Execute Process task giving the details below

Executable - C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe

Arguments - C:\Scripts\test.ps1

when executed I had got the error below -

[Execute Process Task] Error: In Executing "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe" "C:\Scripts\test.ps1" at "", The process exit code was "1" while the expected was "0".

After searching in internet I had changed the argument like below

Arguments -  -ExecutionPolicy ByPass -command “. ‘C:\Scripts\test.ps1

Here, the task is executed without any error but there is no output.

Note : I am running the script to create csv files with data from AD.

Please help me as I am not familiar with power shell script.

Thanks in advance

Anu



Import from XML to SQLServer errors out

$
0
0

Hello,

I created an SSIS package. Here is how it looks like:

I am trying to loop through a bunch of xml files one after the other that start with word connect and insert data from each xml to a sql server table and upon successful insertion delete the file and go to the next one. Incase the insertion fails then send email with the xml file as an attachment.

The enumerator configuration folder has the folder location where the xml files are located and for Files: I provided connect*.xml. I am using a variable at package level with empty string and calling it file and in for each loop editor in variable mappings I set the user::file to index 0.

I am using XML task to use it for XSLT since the xml files have no <root> tag. Its as shown below:

The file is then fed to Data flow task 

the xml source details are as shown below:

I am able to see the columns and able to map to the table in database after data conversion.

However I am getting an error when I run the package:

 

Can someone tell me where I am doing wrong? I dont have any logs here.

Code executed even after errors in script task

$
0
0

Hello all,

I have a container in which 2 steps are being executed. on 2nd step while generating reports, error come. The control goes to step 3 and 4 and code is executed. But when control goes to this contained to another container, the code stops and overall SSIS package execution stops.

Could you please let me know why the code goes to step 3 and 4 when error occurred on step 2. "ForceEexecutionResult" is set to None on the first container.

thanks in Advance.

Export SQL table to Excel in .xlsx format

$
0
0

Hello,

it looks like the system automatically checked "Always create backup" box. I am wondering if there is a way to force it off, maybe thru extended properties?

Many thanks,

Cari


SSIS Package Not Executing from C#

$
0
0

Hi all!  Trying to get a local SSIS package to kick off after the user clicks the Audit button on a Windows form project I built.  Here is the code so far:

            //Variable & object declaration
            string pkgLocation;
            SSIS.Package pkg;
            SSIS.Application app;
            SSIS.DTSExecResult pkgResults;

            //Create new ofd
            OpenFileDialog ofd = new OpenFileDialog();

            //Set ofd settings
            ofd.Title = "Select audit file for processing";
            ofd.Filter = "*.txt files|*.txt";
            ofd.FilterIndex = 2;

            //Display ofd
            DialogResult result = ofd.ShowDialog();

            //Set path for package to execute
            pkgLocation =
                @"C:\Documents\Test\ImportFile.dtsx";
            app = new SSIS.Application();
            pkg = app.LoadPackage(pkgLocation, null);

            //Send variables to package
            pkg.Variables["User::InputFile"].Value = ofd.FileName;

            MessageBox.Show("Next command is to execute package using variable: " + pkg.Variables["User::InputFile"].Value);

            //Execute package
            pkgResults = pkg.Execute();

            MessageBox.Show("Execute command sent");

            //Check the results for Failure and Success
            if (pkgResults == Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure)
            {
                string err = "";
                foreach (Microsoft.SqlServer.Dts.Runtime.DtsError local_DtsError in pkg.Errors)
                {
                    string error = local_DtsError.Description.ToString();
                    err = err + error;
                }
            }
            if (pkgResults == Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success)
            {
                MessageBox.Show("SSIS import triggered successfully.");
            }
            //You can also return the error or Execution Result
            //return Error;

Here are the details:

MessageBox.Show("Next command is to execute package using variable: " + pkg.Variables["User::InputFile"].Value);

and

MessageBox.Show("Execute command sent");

both appear as expected, but then the project just hangs (it seems).  I have the SSIS project open in Visual Studio as well while debugging, and when it gets to that point in the script, VS does not appear to be running the SSIS.  Also, I have never seen the messagebox from this line:

MessageBox.Show("SSIS import triggered successfully.");

so it seems it's hanging somewhere between sending pkg.Execute() and actually starting the SSIS project.

Any thoughts?

Querying SSIS XML definition - package deployment method

$
0
0

Hello,

I need to query the xml defintion of SSIS packages which we have deployed using the package deployment method.

These packages do not exist on the msdb.dbo.sysssispackages table but on the catalog.packages table on the SSISDB database.

Is there a way of querying these packages? We are using SQL 2014 and deployed the packages using Visual Studio 2013.


Thanks


SSIS Script task using Json code on 32 bit machine

$
0
0

Hi,

Following code is running fine on Sql server 2008R2 64 bit machine, I am testing on 32 Bit machine to migrate it to 2012 Sql server I cannot bypass the following error which I have no idea.

Code Overview: After doing an API Call using Curl, to parse the results we are using Json dll and C# code to get the session id.



Code:

using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using System.Collections.Generic;
//using System.Web.Script.Serialization.JavaScriptSerializer;
using Newtonsoft.Json;

namespace ST_f6f87af4693544648f91c847e055fee0.csproj
{
    [Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
    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
        
        public class NetworkId
        {
            public int id { get; set; }
            public string name { get; set; }
            public string url { get; set; }
        }

        // authenticate object
        public class authObject
        {
            public string responseStatus { get; set; }
            public string sessionId { get; set; }
            public int userId { get; set; }
            public string networkId { get; set; }
            public List<NetworkId> networkIds { get; set; }
        }
        public void Main()
        {
            Dts.TaskResult = (int)ScriptResults.Success;
            authObject objJSON = JsonConvert.DeserializeObject<authObject>(Dts.Variables["curlResults"].Value.ToString());
            Dts.Variables["SessionId"].Value = objJSON.sessionId==null?"":objJSON.sessionId;
            if (objJSON.sessionId == null)
            {
                Dts.TaskResult = (int)ScriptResults.Failure;
            }
            using (System.IO.StreamWriter file =
                new System.IO.StreamWriter(@"C:\Users\skonda\Documents\log.txt", true))
            {
                file.WriteLine(Environment.NewLine + DateTime.Now.ToString("MMM ddd d HH:mm yyyy") + "   Get Session Id: " + Dts.Variables["curlResults"].Value.ToString());
            }
            return;
        }
    }
}

Need to store two variables for two select statements in single Execute SQL task

$
0
0

Hi All,

I have two Select statements which will bring me two different Ids, I want to store them in the variables using Execute SQL task. Can I have two select statements in the execute SQL task and store it into two different variables?

Here are my Select statements:

 select Source.ID as SourceTableId
  from [Master] source
  where source.appId = 1
  And source.TableName = 'Art'

  select Target.TableId as TargetTableId
  from [Master] Target
  where Target.appId = 4
  And Target.TableName = 'STG_Art'

Can someone help me in this?




Uploading files to google cloud storage buckets not working

$
0
0

Hello ,

I have to upload files to google cloud storage. I instaaled gsutil from google and authenticated. I uploaded a sample file and its working fine.

And I want to perform the same task with SSIS. This is how I set up execute process task.

It is not throwing any exception but the fill is not uploading. I can not see the file in the bucket.

Am I missing anything ?

Thanks in advance.

SSIS re-try ODBC connection on error

$
0
0

First, the question:   If I have a datareader source that uses an ODBC connection, and that connection errors for some reason, how can I have the package wait a minute and try the dataflow again, and do this n number of times or until it succeeds...but without starting the whole package over again?

Now the background, if you're interested:

I have a package that needs to collect data from over a hundred different (Firebird) databases on 8 remote servers that I can only connect to via ODBC.

The first thing the package does is populate an object variable with a set of connection strings.   Then I loop through that variable, set the connection string of my ODBC Connection Manager, and import data from 10 different source tables into 10 different destination tables.   The package will work fine for a while, through several iterations of the loop, and then it will finally hit a connection error on one of the dataflows.   I can ignore and log the error, and when I'm done I have an incomplete import.   I need to get to a complete, unattended, import.

Seems to me the best approach, if it can be done, would be to catch the connection error, and have SSIS keep re-trying the connection until it succeeds.  The errors are never the result of a permanent issue that needs resolving.   When I manually re-try the package, the same connection/data reader can succeed, and one that succeeded earlier can fail. I can also manually connect to the remote ODBC source and run the same query the package is running.   Probably the errors are temporary network glitches or locking.

By the way, I have already added a script at the beginning of each loop to attempt to acquire the ODBC connection before starting the dataflows.   That script has never had a problem acquiring the connection.


-Tab Alleman

Design pattern for getting the counts.

$
0
0

Hello everyone,

Currently we have a SSIS package which is processing a text file and performing the below actions:

1.Generate failed file for records didn't passed the data validations set rules.

2.Failed due to column mismatch.

3.Insert the successful records into a table.

I need advice as to what will be the optimal approach to handle the below requirement

1. Get the count of records from the failed txt file for a client as the client name could be in any column

2. Get the records from the DB which were processed successfully the source table i know. (Could be done using a SQL Select)

3. If the file wasn't available for the pre-processing

All the above information count of successful + failed or if the file was not available i need to insert into a table. Should i add tasks into the existing package or create a dedicated package for this requirement. Please suggest the available design for this requirement.

Thanks

SSIS Expression Help to Get previous month

$
0
0
"F:\\Opr\\Qt5\\MonthlyDeliveryFile\\Qt_Monthly" + (DT_STR,2.1252)Month(getdate())+ (DT_STR,4.1252) Year(Getdate()) + ".txt"

Hi al,

I have a task where I need to generate a file delivery process which is monthly one file for current month and previous month`s .The above expression gets me the desired output of Qt_Monthly42016 which works for me however I have another task in which i need to create previous month`s file and I want to know how can i assign in the file name previous month,

Desire output is QT_Monthly_03_2016, I tried using : see below but i get an error message. Can someone point me in the right direction???

(DT_STR,2.1252)Month(getdate()-1)                                                                                  

FM

Calling Package from EXCEL VBA, can't find Microsoft.SqlServer.Dts.Runtime

$
0
0

So I am writing a macro to execute a SSIS package deployed to the SSISDB catalog on SQL Server. I found some VB.Net code. It starts with... Imports Microsoft.SqlServer.Dts.Runtime.

Since this is VBA I add a reference to this ddl in the reference dialog, but I don't see that dll in the list.

How can I add?  Is it called something else?  I have SSDT running on my machine, can I browse to that dll?  I did search on my C: drive but got nothing back?

Please help, I want to execute SSIS package from Excel VBA.

Any help appreciated



How to handle errors in dts programming

$
0
0

Hi Guys,

Recently I'm working on DTS and I'm new to this. What I'm trying to achieve is to create a data flow task and get it work.

An error occurred when the code runs to 

package.Execute();

I want to get the detail error information so I can debug my program but I don't know how. So I did some search and find something like

foreach (Step step in package.Steps) { if (step.ExecutionStatus == DTSStepExecStatus.DTSStepExecStat_Completed&& step.ExecutionResult == DTSStepExecResult.DTSStepExecResult_Failure) { int errorCode, helpContext;string errorSource, errorDescription, helpFile, iDofInterfaceWithError; step.GetExecutionErrorInfo(out errorCode, out errorSource, out errorDescription, out helpFile,out helpContext, out iDofInterfaceWithError);

}

}

The problem is those code reference to a dll file called "dtspkg.dll" which I can't find.

So I'm hoping someone might give me some help.

or is there any workaround that I and handle errors?

Thanks!

SSIS - Edit Script... (Script Task) Error

$
0
0

When I tried to edit the script task in SSIS, I am receiving the below error message.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Registration information for this application needs to be updated. To update, log on as administrator and run this command:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\VSTA.exe /HostID SSIS_ScriptTask /setup
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


And simultaneously receiving another message as below:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TITLE: Microsoft Visual Studio
------------------------------

Cannot show Visual Studio 2008 Tools for Applications editor.

------------------------------
ADDITIONAL INFORMATION:

The VSTA designer failed to load:  "System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at VSTADTEProvider.Interop.VSTADTEProviderClass.GetDTE(String bstrHostID, UInt32 dwTimeout)
   at Microsoft.SqlServer.VSTAHosting.VSTAScriptingEngine.EnsureDTEObject()" (Microsoft.SqlServer.VSTAScriptingLib)

------------------------------
BUTTONS:

OK
------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.

$
0
0

Hi,

Getting the below Error while creating connection between SSIS ETL package and SQL Server.

"SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "connection" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed."

Can anyone help me on this!!

Much Appreciated!!


Row delimeter problem

$
0
0

Hi all,

I'm trying to process flat files with SSIS 2014. Everything was OK before upgrade SSIS packages from 2008R2 to 2014 but now I have some problems. I tried to figure out what is wrong and checked these files content.

The files that I have are delimited with {LF}. Sometimes I see that one row is divided by {CR}{LF} into few parts. SSIS think that {CR}{LF} is a new row and file processing fails.

When all packages were on 2008R2 version row delimiter was set to {CR}{LF} in flat file connection. Now I'm trying to set {CR}, {LF} or {CR}{LF} and all results are the same. Seems that SSIS cannot apply this settings and part of rows are recognized as new rows.

How can I solve this issue?

SSIS Foreach Loop Container - looping progress frozen after first file

$
0
0

I have an SSIS 2005 package migrated to SSIS 2008 BIDS ; in this package, I have a Foreach loop container, which reads text files from A to E, i.e. 5 files. 

For some unknown reasons, when I run the package (in development mode, F5), just a black window flashes, and only the first of the files, i.e. file A is read. and the Foreach loop Container is yellow and frozen; and the loop does not proceed to file B or further; on the other hand I do not see any error in the Progress tab, while the package execution is complete! Even file A is not loaded into the final destination, but stops with my transformation (Fuzzy Lookup) inside the Foreach loop Container.

I am using a Fuzzy Lookup transformation inside the Foreach loop container; I believe this works fine in SSIS 2005 (though haven't tried), but in SSIS 2008, I am not sure.

For the Foreach loop Container, I have a user variable (MyVariable) whose scope is the SSIS package.  The connection manager for these 5 files, is tied to this variable from the  Connection String property : @[User::MyVariable]

This is a part of Chapter 5 (Managing Control Flow)  in the Microsoft Press book on SSIS 2005.

Any suggestion will be greatly appreciated.










Viewing all 24688 articles
Browse latest View live


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