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

Execute Process Task configuration for WinSCP

$
0
0

Hi Experts,

I've been tasked to use WinFTP to pull files from an sFTP site to our local W2007 server using an SSIS Execute Process Task.  I'm trying to get the task to run a script containing the UN/PW and other info, text below.  The script works from the command line:


Here's the Process window from the task:

When I run the task, the error says Host "\script=C" does not exist.  Are there some special characters I need to use around the colon or something?  It's like the task isn't sending the complete path.

Here's the text of the script, in case it matters.

option batch abort
option confirm off
open sftp://User:Password@site
get Media*2013.txt C:\FTP\
get Media*2014.txt C:\FTP\
close
exit

None of the recommended solutions I've found have worked for me.  Help!?! Please???

Thanks in advance!



Variable not found when package executes.".The element cannot be found in a collection."

$
0
0

This is a very simple tutorial demonstrating script task. 2 variables

intvar int32 5

strvar string 0

And a script task with this code


If Dts.Variables("intVar").Value > 10 Then
            Dts.Variables("strVar").Value = "Big"
        Else
            Dts.Variables("strVar").Value = "Small"
        End If

        MsgBox(Dts.Variables("strVar").Value)

below is the error msg

SSIS package "Package.dtsx" starting.
Error: 0x1 at Script Task: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there.
 ---> System.Runtime.InteropServices.COMException (0xC0010009): The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there.

   at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSVariables100.get_Item(Object Index)
   at Microsoft.SqlServer.Dts.Runtime.Variables.get_Item(Object index)
   --- End of inner exception stack trace ---
   at Microsoft.SqlServer.Dts.Runtime.Variables.get_Item(Object index)
   at ST_ce37649a37c146518fa69eff106c6625.vbproj.ScriptMain.Main()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
Task failed: Script Task
Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "Package.dtsx" finished: Failure.
The program '[2824] Package.dtsx: DTS' has exited with code 0 (0x0).

SSIS Conditional Split query

$
0
0

Hie,

There is a scenario where i am using the multicast transformation & on which i need to perform five condition checks,

So i have used 5 conditional split after the multicast component which directs to 5 derived columns,

Is there any way so that i can bypass using multicast & 5 conditional splits & dervied columns respectively ???

Kindly help me find the solution if exists ??

Regards,

Rohit Shah

SSIS Package Job schedule Issue

$
0
0

Hello,

I have creasted one SSIS Package and scheduled it on SQL server Agent. It is giving an below error while running this Job.

[ I am Using Sqlserver 2012 and i have used File System option while Scheduling a Job  ].

Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 64-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  8:37:00 AM  Error: 2014-01-30 08:37:00.72     Code: 0xC0016016     Source: Package      Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.  End Error  Error: 2014-01-30 08:37:00.83     Code: 0xC00291EC     Source: Execute T-SQL Statement Task Execute SQL Task     Description: Failed to acquire connection "MyConnection". Connection may not be configured correctly or you may not have the right permissions on this connection.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  8:37:00 AM  Finished: 8:37:00 AM  Elapsed:  0.344 seconds.  The package execution failed.  The step failed.

Could you please suggest me for the same.

Converting Oracle query to Sql Server with date manipulation

$
0
0

The following SSIS statement works great in Oracle, and it parses successfully in the "Sql Task" window. In Oracle it returns this result:
FROM_DT              THRU_DT
16-Jan-2014      23-Jan-2014

select 
   case 
        when to_char(to_date(sysdate,'dd-mon-yyyy'),'dd') <=7 then to_date('24'||to_char(add_months(sysdate,-1),'mmyyyy'),'ddmmyyyy')
        when to_char(to_date(sysdate,'dd-mon-yyyy'),'dd') <=15 then to_date('01'||to_char(sysdate,'mmyyyy'),'ddmmyyyy')
        when to_char(to_date(sysdate,'dd-mon-yyyy'),'dd') <=23 then to_date('08'||to_char(sysdate,'mmyyyy'),'ddmmyyyy')
        else to_date('16'||to_char(sysdate,'mmyyyy'),'ddmmyyyy')
   end as from_dt,
   case 
        when to_char(to_date(sysdate,'dd-mon-yyyy'),'dd') <=7 then trunc(last_day(add_months(sysdate,-1)))
        when to_char(to_date(sysdate,'dd-mon-yyyy'),'dd') <=15 then to_date('07'||to_char(sysdate,'mmyyyy'),'ddmmyyyy')
        when to_char(to_date(sysdate,'dd-mon-yyyy'),'dd') <=23 then to_date('15'||to_char(sysdate,'mmyyyy'),'ddmmyyyy')
        else to_date('23'||to_char(sysdate,'mmyyyy'),'ddmmyyyy')
   end as thru_dt
from sys.dual

How can I convert this to Sql Server ?


Please provide the C# code to run Macro code on Excel by using script task in ssis ?

$
0
0

Please provide the C# code to run  Macro code on Excel by using script task in ssis

macro code:

Sub DBMatch_InputFormat()
'
' Macro recorded 8/8/2011 by ngrant
'
    Columns("A:G").Select
    Selection.NumberFormat = "@"
    Columns("G:G").Select
    Selection.NumberFormat = "mm/dd/yyyy"
    Columns("H:H").Select
    Selection.NumberFormat = "mm/dd/yyyy"
    Columns("I:I").Select
    Selection.NumberFormat = "#,##0.00"
    Columns("J:M").Select
    Selection.NumberFormat = "@"
    Columns("N:N").Select
    Selection.NumberFormat = "mm/dd/yyyy"
    Columns("O:AO").Select
    Selection.NumberFormat = "@"

    Set currentWorkSheet = ActiveWorkbook.Worksheets(1)
    usedRowsCount = currentWorkSheet.UsedRange.Rows.Count
    
    For Row = 1 To (usedRowsCount)
    Cells(Row, 42).Value = "1"

    Next Row

End Sub

Finding all the Stored Procedures in a SSIS PKG

$
0
0

Hi

I need to find a SSIS pkg that calls a specific SP. Since we have number of very big SSIS
pkg for data feed, it is time consuming to search for a SP in each pkg. The
problem i am facing is i have to find the data source for a specific column in
a table. I was able to find all the SP that uses the column, now i have to find
which SSIS pkg calls the SP.

Advance thanks for any help

Thanks

RV




how can I get the row number(error row) while constraint failure at the OLE DB destination?

$
0
0

my project is insert data to OLE DB destination from csv file.

my question is

how can I get the row number(error row) while constraint failure at the OLE DB destination?

thanks.

 


File System Task Editor closes when selecting DestinationVariable

$
0
0
I've set up a File System Task to move a file. I set IsDestinationPathVariable to True. When I click inside the DestinationVariable value column and either click the drop-down arrow or hit the up/down arrow keys on my keyboard, the File System Task Editor window closes immediately. In the same task, I have also set IsSourcePathVariable to True and am able to select SourceVariable without an issue. If I set IsDestinationPathVariable to False, the DestinationConnection drop-down appears to work fine. I've tried restarting Visual Studio, but it had no effect.

UPDATE .NET Framework for BIDS/SSIS

$
0
0

I have updated .Net FW on the Windows Server that hosts SQL/BIDS.

However, I don't think the update was applied for BIDS (still don't see libraries from the the latest version I installed) in Script Task/Components.

How can I update .NET in BIDS?

Using Windows Server 2012 and SQL Server 2012.

Returning Data from a Linked Server EXEC

$
0
0

I am trying to call a EXEC and pass a Sales Order # to it, returning the # of Tickets:

USE [ATPROD]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[SP_XX_TESTFN] 
@SalesOrderNo nvarchar(7), @NumNow int OUTPUT
AS
BEGIN
SET NOCOUNT ON
DECLARE @xNumNow int 
EXEC ('SELECT count(*) FROM JT_Transaction WHERE SalesOrderNo = ''' +@SalesOrderNo+ ''' ', @NumNow OUTPUT) AT MAS90RW;
END

According to Microsoft, the variable @NumNow should have been passed to the calling EXEC:

USE [ATPROD]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[SP_XX_TESTExec] 
AS
BEGIN
SET NOCOUNT ON
DECLARE @NumNow int, @SalesOrderNo nvarchar(7), @xNumNow int, @Result int 
SET @SalesOrderNo = '0008410'
set @xNumNow = null 
set @NumNow = null 
exec @Result = dbo.sp_XX_TESTFN @SalesOrderNo,  @NumNow = @xNumNow OUTPUT 
SELECT @Result as Result, @xNumNow as NumNow
END

The resultant @xNumNow is NULL

The SP_XX_TESTFN does return 2000+ records but refuses to return that to the calling procedure.

Anyone know what is going wrong?

 

Are unique GUIDs required in the data flow task in SSIS?

$
0
0

Hi,

I have previously used SQL server 2008R2 to develop packages.  I was told not to copy and paste packages, or create templates with tasks on the data flow because this leads to multiple packages with the same GUID, the consequence of this might be calamitous problems at runtime when the engine can't distinguish between tasks in different packages.

My process was to create templates with Control flow tasks only, manually create the dataflow tasks and then use bids helper from codeplex to regenerate GUIDs (this regenerated the GUIDs at the control flow level only).

I am now using SQL 2012. I have looked and seen that if I copy and paste a package the GUIDs at the data flow level are also copied.  So my questions are:

1) Does having the same ID in different dataflows cause problems as I was led to believe?

2) If it does has this been addressed in some way in SSIS 2012? and what is the best way of working around this given I have many similar packages to develop?

Thanks,

Dan

SSIS Scripting for dynamic column mapping.

$
0
0

Hi everyone,


Ok so here is my situation.

I have files in a folder.

I am loop through a resultset which has the file names as one of the fields.

When I get the current file,

I want to be able to alter the column / transformation mapping based on the mapping table.

As you can see in the image provided below - the reason for this is that all the files don't have the same column order.

Firstly, can this be done in SSIS?

Secondly, how would I go about it

Finally, can you show me an example of that if it is possible.

Thank you.

Why are columns not aligned when createing txt file.

$
0
0

I am sending resluts from query to a flat file, then using flat file for the body of email I send.  I am having hard time aligning my 4 columns columns.  I have tried various combination of delimited and fixed width columns.  I have tried .txt and .htm extensions on flat file.  All feilds are cast as nvarchars in SQL query, including some dates.

However my flat file looks is how the body looks, so I am convinced if I can get the colunms aligned in the flat file, the columns will be aligned in the body of my email.

how ever I configure my flat file connection I can't get the columns to alighn. 

Will the approach I am taking even work, as far as aligning columns?  Everything works great except columns are not aligned.

Any help appreciated

Please help,

Thanks,

Mike

exporting access data into xml file

$
0
0

Hi,

I have access db in MS2000 format. I alter/use it in 2007.

I want to export all the tables from access to sql server 2008 R2. The tables (same as access tables) are not created in sql server yet. At runtime, I want to create 1 task in ssis to export the access table data to sqlserver tables.

Currently I create xml files in ms access itself manually and then 1 DTS package in ssis transfers all the xml data to sql server 2008 R2.

Let me know if any doubts over here. May be the question is, whether we can export data from access to sql server with table creation.

Thanks,

Shenoy


SSIS: To run a SSIS package outside of SQL Server Data Tools you must install SCR - DP1 Connections of Integration Services or higher

$
0
0

We have SSIS installed on a machine that is not part of a cluster but it is accessible by the cluster.

Our job we have running on the cluster is failing with the following error:

Error: 2014-01-31 09:14:37.52     Code: 0xC000F427     Source: SCR - DP1 Connections  
Description: To run a SSIS package outside of SQL Server Data Tools you must install SCR - DP1 Connections of Integration Services or higher.  End Error

Any advice or information on how to resolve this would be great.

Many Thanks.

SSIS connection problem -- inexplicable red box

$
0
0

I've developed a lengthy SSIS package to migrate data from an old database to a new SQL Server 2008 database. My workstation is on the same domain as our dev SQL server. The SSIS package has several connection managers. When I'm connecting to the databases in the dev environment, everything works fine.

As a final stage in testing the package, I'm trying to change the connection managers of the source databases to our production environment. Production is in a different, untrusted domain. I'm using SQL Server authentication. When I change a connection manager from the dev server to the production server, I click the Test Connection button and see "Test connection succeeded." I go to an OLE DB source object that uses this connection manager. I click the "Preview..." button and it successfully displays sample data. But when I try to execute the step that contains this OLE DB source object, I get these error messages and the box turns red:

Error: There were errors during task validation.

[SSIS.Pipeline] Error: One or more component failed validation.

[SSIS.Pipeline] Error: component [OLE DB source object name] (329) failed validation and returned error code 0xC020801C.

[PRIMS Commands [329]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager [Connection Manager name] failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.

For the provider on the connection manager, I've tried SQL Server Native Client 10.0, SQL Server Native Client 11.0, and Microsoft OLE DB Provider for SQL Server. All of them give me the same failure.

I'd really appreciate any suggestions. Thanks.

Addendum.  In my troubleshooting, I've turned off Run64BitRuntime, and the connections work.  Why would 64-bit runtime work when connecting to the dev server but not the production server?

This isn't really a good workaround for my problem because the package uses a fuzzy lookup transformation, which only runs in 64 bit mode.  I might be able to separate that out into another package, but that would be inconvenient at best.

SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server 2012 Analysis Services." Hresult: 0x80004005 Description: "Internal error: An une

$
0
0

SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.  An OLE DB record is available.  Source: "Microsoft OLE DB Provider for SQL Server 2012 Analysis Services."  Hresult: 0x80004005 Description: "Internal error: An unexpected error occurred (file 'pcxmlacommon.cpp', line 43, function 'PCFault::RaiseError').

I'm getting above error in the pre- execute phase of a DFT when I'm trying to fetch data from a SSAS cube using mdx query.
I'm using OLE DB provider for connecting to cube.

I got one resolution for Error Code 0X8004005, which asked me to add 'Format= Tabular' in cube's connection string. It does not seem to work either. Can any one help me out on this???

OLE DB-Command use incoming columns as Variable

$
0
0

Is it possible tu use a field that gets into an OLE DB-Command Transformation as a variable.

Say i have EmployeeName that i want to store into a SQL Table, in what way could i use it to write insert Statements of this king as a Command:

INSERT INTO Table1 Values
           (@EmployeeName
		   )

?

Thanks a lot in advance

How to fix - Cannot find object/table in database error when it actually exists ?

$
0
0

I made a console C# app in which I generate SQL to insert a row into a table info_table and then execute it. When I use the same C# code (with necessary modifications of course) in SSIS, I get an error saying that the table cannot be found. 

Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. 
---> System.Data.SqlClient.SqlException: Invalid object name 'info_table'.

I know there is a info_table in my database and it works in the console app. So, I tried to use the fully qualified name in my SSIS C# script instead of just info_table and the error went away. Why does this happen and how do I fix it ? I doubt if there is a problem with my SSIS connection string. 

My SSIS connection String (connection manager is ADO.NET type) - 

Data Source=.;User ID=admin;Initial Catalog=MaximDB;Persist Security Info=True;Application Name=SSIS-DataReader-{555000dddd-aaa-bbb-cccceee}LocalHost.MaximDB.admin;

My console app connection String - 

"server=(local);database=MaximDB;integrated security=SSPI;";

The C# objects to connect to the database - 

For Console C# app -

          SqlConnection conn = new SqlConnection(consoleString);

For SSIS C# script -

            String ssisDbConnMgr = "SAMPLE_DB";//Name of the connection manager in SSIS, an ADO.NET type

            ConnectionManager connMgr;
            SqlConnection databaseConn;
            SqlCommand sqlCmd;
            connMgr = Dts.Connections[ssisDbConnMgr];
            databaseConn = (SqlConnection)connMgr.AcquireConnection(Dts.Transaction);
            sqlCmd = new SqlCommand();




Viewing all 24688 articles
Browse latest View live


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