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

SSIS task "Transfer SQL Server Objects Task" and Default Constraints on tables

$
0
0

 

I am using the "Transfer SQL Server Objects Task" to copy some tables from database A to database B including data.

The tables, primary key constraints, Foreign key, data and all transfers nicely except for "DEFAULT CONSTRAINTS" on the tables.

I have failed to find any option in the "Transfer SQL Server Objects Task" task to explicitly say "copy default constraints". So I guess logically it should happen automatically but it doesn't. I hope it is not a bug :-)

 

Any option anyone knows will help.

 

Thanks.


Executing Oracle package with Script Component Task

$
0
0

Hi All,

I'm currently doing a SSIS package to migrate data from SQL Server 2012 to Oracle. 

I have an Oracle procedure within an Oracle Package. The procedure is as per below:

   PROCEDURE Get_Days_Limit(pMineCode IN VARCHAR2, rec_cursor OUT t_cursor) 
   IS
        
   BEGIN
   
   OPEN rec_cursor FOR
      SELECT MAX_LOAD_DAY 
          FROM SSIS_CONFIG
        WHERE MINE_CODE = pMineCode;
   END;

I have a script component which execute the above procedure. Below is the script for the script component. 

using System;
using System.Data;
using System.Data.OracleClient;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;

[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
    private IDTSConnectionManager100 connMgr;
    private OracleConnection oracleConn;
    private OracleCommand oracleCmd;

    public override void AcquireConnections(object Transaction)
    {

        base.AcquireConnections(Transaction);

        connMgr = this.Connections.TSA;
        oracleConn = (OracleConnection)connMgr.AcquireConnection(Transaction);
    }

    public override void PreExecute()
    {
        string plsql;
        
        base.PreExecute();

        plsql = "BEGIN tsa_interface_mfl_pkg.Get_Days_Limit(pMineCode,rec_cursor);END;";
        oracleCmd = new OracleCommand(plsql, oracleConn);

        oracleCmd.CommandType = CommandType.Text;
        oracleCmd.Parameters.Add("pMineCode", OracleType.VarChar);
        oracleCmd.Parameters.Add("curMaxDays", OracleType.Cursor);
    }

    public override void PostExecute()
    {
        base.PostExecute();

        if (oracleCmd != null)
        {
            oracleCmd.Dispose();
        }
    }

    public override void ReleaseConnections()
    {
        base.ReleaseConnections();
        connMgr.ReleaseConnection(oracleConn);
    }

    public override void CreateNewOutputRows()
    {
        try
        {
            string mineCode = Variables.pMineCode;
            oracleCmd.Parameters["pMineCode"].Value = mineCode;

            OracleDataReader dr = oracleCmd.ExecuteReader();

            if (dr.HasRows)
            {
                Output0Buffer.AddRow();
                Output0Buffer.MaxLoadDays = dr[0].ToString();

                Variables.MaxDaysCount = Convert.ToInt32(dr[0].ToString());
            }

        }
        catch (Exception ex)
        {
            this.ComponentMetaData.FireInformation(-1, "Extract Data", ex.Message, string.Empty, 0, true);
        }

        Output0Buffer.SetEndOfRowset();
    }

}

The issue that I'm having is an exception is raised at the following line OracleDataReader dr = oracleCmd.ExecuteReader();.

The error is ORA-01036: illegal variable name/number\n.

Can anybody help me on the above issue? I've spent quite some time on the above and i can't figure out why the error is raised.

Initially, I tried using Execute SQL Task (without the cursor parameter in the procedure) and it was still failing. 

Any help or suggestions will be greatly appreciated.

Thanks

Delete first two rows in a csv file

$
0
0

Hello,

I have a csv file which I download daily from a FTP server. The problem is that the first to line is a text descriping the vendor etc. and then from the third row and down the actually csv file start. The file is looking like below.

© 2014 by Vendor, Inc.

Data 08182341 00259 FINAL     EB  20140818

N AAIDL00c 20140818 910.5

N AAIDL00h 20140818 910.75

N AAIDL00l 20140818 910.25

I would like to know how I delete the first to rows in SSIS before I load the data into the database.

Thanks.

Cannot create a debug host for the package - SSIS 64 bit error

$
0
0

All,

I am unable to run SSIS package from BIDS. Its developed using SSIS 2012. When i change the project setting to run in 32-bit, it runs. 64 bit it does not.

Below is the configuration: -

System - Windows 7 Enterprise Service Pack 1 - 64 bit

SQL/SSIS - Microsoft SQL Server 2012 (SP1) - 11.0.3000.0 (X64)
 Oct 19 2012 13:38:57
 Copyright (c) Microsoft Corporation
 Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)

Error details: -

===================================

Cannot create a debug host for the package. (Microsoft Visual Studio)

------------------------------
Program Location:

   at Microsoft.DataTransformationServices.Project.DataTransformationsPackageDebugger.LaunchVsDebugger(IVsDebugger iVsDebugger, DataTransformationsProjectConfigurationOptions options)
   at Microsoft.DataTransformationServices.Project.DataTransformationsPackageDebugger.ValidateAndRunDebugger(Int32 flags, IOutputWindow outputWindow, DataTransformationsProjectConfigurationOptions options)
   at Microsoft.DataTransformationServices.Project.DtsPackagesFolderProjectFeature.ExecuteTaskOrPackage(ProjectItem prjItem, String taskPath)

===================================

Cannot communicate with the debug host process. Failed to obtain child process active object. (Microsoft.DataTransformationServices.VsIntegration)

------------------------------
Program Location:

   at Microsoft.DataTransformationServices.Project.DebugEngine.DebugEngine.LaunchDtsDebugHost(Process& process, Boolean run64bit)
   at Microsoft.DataTransformationServices.Project.DebugEngine.DtsProgramNode.CreateRuntimePackageInternal(IDtsHost& host, Process& process, Package& dtsPackage)

 Could you please help me in resolving the issue? Thanks.

One source to multiple tables

$
0
0

Hi,

We have one source (Access) and one destination (SQL Server) and is working fine with 1 table - fast load method.

We now need the data to be transformed into 4 separate tables. Should we:

Use a SQL command for data access mode?

OR

Use a Multicast transformation?

OR

Use a script component for destination?

OR

Use a stored procedure to transform the data once in a staging table?

- What seems the best procedure and why? 



FTP task runs fine from SSIS Package Store, always times out in scheduled job

$
0
0
  • SQL Server 2012
  • VS 2010 SQL Server data tools
  • FTP Connection Manager
  •  - port 21, chunk size 1kb, passive mode=false, saved plain text pw
  • Downloads 1 csv file to local directory on SQL Server box

This always works when run from the package.  And always gives a timeout error when scheduled.

Message
Microsoft (R) SQL Server Execute Package Utility
Version 11.0.2100.60 for 64-bit

Started:  11:04:59 AM
Error: 2014-03-27 11:05:31.12
   Code: 0xC001602A
   Source: xxx Connection manager "FTP Acme1"
   Description: An error occurred in the requested FTP operation. Detailed error description: The operation timed out
End Error
Error: 2014-03-27 11:05:31.14
   Code: 0xC002F304
   Source: Acme FTP Task
   Description: An error occurred with the following error message: "An error occurred in the requested FTP operation. Detailed error description: The operation timed out".
End Error
DTExec: The package execution returned DTSER_FAILURE (1).
Started:  11:04:59 AM
Finished: 11:05:31 AM
Elapsed:  31.949 seconds

SQL Server Agent is set to Logon As my domain account, and in the package history it says "logged on as " my account.

Any suggestions?  Thank you

.net 3.5 GAC installed assmebly not showing

$
0
0

Hi.

I've put System.Threading into the GAC for .net 3.5.

However when I try and reference this in a SSIS script it doesn't come up on the .NET tab on the reference screen. I've set the .net framework at the project level to be 3.5.

 I need to use this assembly and it's registered in the GAC why would I not be able to reference it or why does it not show in the GAC .NET reference list?

Thanks


shaun

Execute Package fails due to package validation

$
0
0

There is an execute package task that calls the child package.  Both parent and child packages have the same password and the passwork is entered into the execute package task.  Both packages reside in the same directory path.

Error: Error 0xC0012050 while loading package file "C:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\ExecutePackageTest\ExecutePackageTest\ExtractandWrite.dtsx". Package failed validation from the ExecutePackage task. The package cannot run.

When ExtractandWrite.dtsx is executed by right-clicking on package, the package executes without any errors.

DelayValidation = True for the Execute Package Task tasks is set and DelayValidation for the connection manager is set to True.

Does anyone have any thoughts as to what might be causing this error?

Thanks in advance for your assistance.


Script Task - AcquireConnection for (FLAT)FILE connection manager

$
0
0

Is it useful to use the Acquire method (and release afterwards) when using a FILE Connection Manager in a Script Task?

object rawConnection = Dts.Connections["file.txt"].AcquireConnection(Dts.Transaction);
string filePath = (string)rawConnection;
//Use the connection in some code here, then release the connection
Dts.Connections["file.txt"].ReleaseConnection(rawConnection);
or can I just use the connectionstring property to do something?
string filePath;
filePath = Dts.Connections["file.tx"].ConnectionString;
// Use the connectionstring in some code here

Disable option inside Data Flow task

$
0
0
We can disable a task at control flow.
But there is no option for disabling a component inside a data flow task. Why?
Suppose I have a component and I dont want it inside my package but want to keep it so that I can use it again if required.
Any idea, how to do this....

Nitesh Rai- Please mark the post as answered if it answers your question

SSIS Integration with Salesforce.com

$
0
0

Hi,

We required toextracting salesforce.com data using SSIS and store in SQL database. Is SSIS provides the way to interact with Salesforce.com? Please let me know the possible ways to extract data from salesforce.com/ any blog/ articles on this.

 

Many Thanks!

SSDT BI VS2012 crashes when Control Flow objects opened for edit

$
0
0

My SSDT BI for VS2012 was running fine for a year.  However, I can no longer open Control Flow Objects for editing.  Opening any Control Flow object causes SSDT BI to crash.  I completely uninstalled SSDT for BI along with .Net framework.  I reinstalled SSDTBI VS2012 and let that installation reinstall the required .Net framework software.  The SSDT for BI install finished without error.  However, SSDT BI for VS2012 still crashes whenever I try to open a Control Flow object. Please let me know if you have any suggestions.

Here is the log from Event Viewer:

Application: devenv.exe Framework Version: v4.0.30319 Description: The process
was terminated due to an unhandled exception. Exception Info:
System.AccessViolationException Stack: at
Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSPersist100.SaveToXML(System.Object,
System.Object, Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSEvents100) at
Microsoft.SqlServer.Dts.Runtime.PersistImpl.SaveToXML(System.Xml.XmlDocument
ByRef, System.Xml.XmlNode, Microsoft.SqlServer.Dts.Runtime.IDTSEvents) at
Microsoft.SqlServer.Dts.Runtime.DtsContainer.SaveToXML(System.Xml.XmlDocument
ByRef, System.Xml.XmlNode, Microsoft.SqlServer.Dts.Runtime.IDTSEvents) at
Microsoft.SqlServer.IntegrationServices.Designer.Undo.DtsPersistSnapshot.GetSnapshotHelper(Microsoft.SqlServer.Dts.Runtime.IDTSPersist)
at
System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr,
System.Object[], System.Object, System.Object[] ByRef) at
System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage,
System.Runtime.Remoting.Messaging.IMessageSink) at
System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(System.Object)
at
System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at
System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean) at
System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean) at
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch() at
System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

complete exit from pkg on certain condition

$
0
0
How to exit entirely from pkg on meeting certain condition, is there any way to exit entirely ? I tried it worked for exiting from the transmission component alone and passed the control to next component.. but I am trying to exit from entire pkg itself

Neil

SSIS Data Viewer doesn't show all results

$
0
0

I have 2 records which aren't make it through an ETL process.

When I use Data Viewers along the way, to see the results from each step, I'm only shown part of the results (e.g. ~9000 instead of ~35,000).

How can I see all the records that come out of each step? Are Data Viewers the right solution?

I know for sure I'm not getting all the records, because if I run those particular steps in queries manually I get all my ~35,000 records.

Is there a better way to troubleshoot than Data Viewers?

I'm using Microsoft Visual Studio 2008.

SSIS , SQL server and Vistual Studio Compability

$
0
0

Hi

   I have dtsx package file which is downloaded from sql server forum. I want to inspect the content of dtsx package. I am new to Sql Server Integration Service. Please can someone guide me how to inspect the content of dtsx package

 we are using "SQL Server 2012" .I have installed visual studio 2010 and Visual studio 2013.

When I open package  in "Visual Studio 2010" it gives me error "Microsoft  Visual Studio is unable load this document: To design integration service packages in sql server data tools (SSDT), SSDT has to be installed by one of these editions of SQL Server 2012: Standard, Enterprise, Develper or Evaluation............".

When I tried to open this package in VS 2013 , I don't see the project template for "Integration Services Project".

thanks for help


Drew


Extracting Data From Attask Using SSIS

$
0
0

Hi guys,

I am currently working on a BI project and I am meant to use AtTask Project Management Application as one of my data sources for the ETL.

Please can someone tell me which SSIS component that I can use to load data from the AtTask into  my data warehouse.

Thanks


me

Is the API for programatically executing packages redistributable?

$
0
0
For applications created by an ISV that depend on "Microsoft.SQLServer.ManagedDTS.dll" to programatically execute packages: can this DLL legally be packaged with the application, rather than requiring it to be installed as a prerequisite?  I am unable to find any documentation that specifies either way.

Passing a SSIS resultset to a stored procedure...

$
0
0

Hello,

I need to pass a resultset variable from a SSIS component to a stored procedure.  I created a resultset variable, but when I create my execute SQL task and create the parameter I fail to see a viable datatype to use...ie when I created the resultset variable I set the datatype to object.

The way I envision what I am trying to do is as follows:

1) read in the source data a data source and dump it into a resultset variable

2) pass the resultset variable to a sql stored procedure

3) the stored procedure will then cursor through the resultset and manipulate the data accordingly

4) end of process...control is returned to SSIS component that called the stored procedure

I don't want to mess with scripting, most of what I need is already written in a stored procedure and I would prefer to keep it that way.

Any suggestions???

SSIS 2008R2 project file gets disturbed by Analysis Service file (.database)

$
0
0

Hi,

We have several SSIS 2008R2 projects that when we open them complains about a missing file and it happens on different installations of Business Intelligence Development Studio (BIDS) as well. The error message:

The item <project path><Solution/Project name>xx.database could not be found in your workspace, or you do not have permission to access it.

xx is a number and grows for each time we try to open the solution. You have to say ok to the message.

The result is that the solution opens but with the SSIS project "Unavailable". To get the project to load we have to right click on the project and choice "Reload". Then BIDS asks if it is ok to create the file and when you say yes, the file is created and added to the project file like this:

<Database>
    <Name><project name> xx.database</Name>
    <FullPath><project name> xx.database</FullPath>
  </Database>

In Windows Explorer the extension description of the .database file is "Analysis service database"

1) How come a .database file is all of the sudden comming into a SSIS project?

2) How do I avoid having the file in the project or how can I make sure that the project opens everytime without having to say reload and create a new database file?

The content of the . database file is:

<Database xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:dwd="http://schemas.microsoft.com/DataWarehouse/Designer/1.0" dwd:design-time-name="2123b6e5-2b4e-47d2-8fb6-c90180840eb6" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
  <ID><project name></ID>
  <Name><project name></Name>
  <CreatedTimestamp>0001-01-01T00:00:00Z</CreatedTimestamp>
  <LastSchemaUpdate>0001-01-01T00:00:00Z</LastSchemaUpdate>
  <LastProcessed>0001-01-01T00:00:00Z</LastProcessed>
  <State>Unprocessed</State>
  <LastUpdate>0001-01-01T00:00:00Z</LastUpdate>
  <DataSourceImpersonationInfo>
    <ImpersonationMode>Default</ImpersonationMode>
    <ImpersonationInfoSecurity>Unchanged</ImpersonationInfoSecurity>
  </DataSourceImpersonationInfo>
</Database>

Thank you for any help or pointers

Peter

how can we find duplicate in a csv file using script component to find the duplicate record.

$
0
0

how can we find duplicate in a csv file using script component to find the duplicate record. The duplicate record can be placed at any position. so we cannot compare the previous row with current row in script component. Please suggest how can we find duplicate in script component using c#

1260153483= EIN

KINGCX=USERID

KINGCX@ZHI.COM=EMAILID

the above record is duplicate , since Record no 2 and   5 are same

9562771626MEYERTN        MEYERTN@ZHI.COM
1260153483KINGCX         KINGCX@ZHI.COM
2046242194JONENJ         JONENJ@ZHI.COM
214390374MILLERSJ       MILLERSJ@ZHI.COM
1260153483KINGCD         KINGCD@ZHI.COM

Viewing all 24688 articles
Browse latest View live




Latest Images