SSIS accessing a dts package properties with C#

Hello there, 
Please, Could anyone help me and let know how i can access the "DTS package" Proeperties eg. PackageName?
And which namespace does DTS belong to: (as in "using Microsoft.SqlServer. ....")
In C# please!

Hi,
This is a sample code for reading the package transformation info
static void Main(string[] args)
String location = @"DTS.Old\SomeDTSPackage.dts";
DTS.Package pkg = new DTS.Package();
DTS.Task task;
DTS.DataPumpTask2 dataPumpTask;
DTS.Transformation transform;
DTS.Column source;
DTS.Column destination;
pkg.LoadFromStorageFile(location, null, null, null, null, null);
Console.WriteLine("{0}", pkg.Name);
Console.WriteLine(" TASKS");
for (Int32 tsk = 1; tsk <= pkg.Tasks.Count; tsk++)
if (pkg.Tasks.Item(tsk).CustomTaskID == "DTSDataPumpTask")
dataPumpTask = (DTS.DataPumpTask2)pkg.Tasks.Item(tsk).CustomTask;
Console.WriteLine(" TRANSFORMS");
for (Int32 trans = 1; trans <= dataPumpTask.Transformations.Count; trans++)
transform = dataPumpTask.Transformations.Item(trans);
for (Int32 col = 1; col <= transform.SourceColumns.Count && col <= transform.DestinationColumns.Count; col++)
source = transform.SourceColumns.Item(col);
destination = transform.DestinationColumns.Item(col);
Console.WriteLine(" {0} -> {1}", source.Name.PadRight(15, ' '), destination.Name);
Console.ReadKey(true);
Joe

Similar Messages

  • When migrating dts package to ssis 2005 version

    Hello,
    When migrating dts package to ssis 2005 version I'm getting below error.
    Component with name "DupCheckXLS" and class ID "{5A0B62E8-D91D-49F5-94A5-7BE58DE508F0}" could not be created because an error was encountered during its upgrade to the current version.
    Contact information:
    Any help would be helpful.

    may be components and properties available on 2005 that are not available on 2000.You need to re create the task in SSIS.
    Yes. that has been my experience always. One or more tasks have to be recreated. The architecture itself is different in SSIS. Thats why I feel it might be better to recreate package in SSIS rather than trying to migrate and then fix the issues
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Upgrade Preparation: How to map applications, DTS packages, SSIS packages and reports to databases

    Hi,
    I am on the initial phase of upgrading SQL Server 2005 to SQL Server 2012. Right now, I'm taking as much inventory as I can from our current server, SQL Server 2005. If anyone could help me, how can I map the following:
    Map applications to databases
    Map DTS packages to databases
    Map SSIS packages to databases
    Map reports to databases
    Thank you!

    Some questions and suggestions:
    How are we planning to upgrade whether in-place\parallel\others?
    Will this be with HA[Clustered one] or with standalone?
    Do you have time to do actual migration from now on and you will need to setup the environment for end to end testing for application validation so that all differences between application or system variables can be known before actual deployment?
    Also, it will be good to check with Upgrade Advisor for below pointers preparedness too.
    Map applications to databases: If you have already need to setup databases and logins for each and every applications then your mapping to database for applications will be lot  easier and you will have less challenge.
    Map DTS packages to databases: Good link to check
    https://www.simple-talk.com/sql/ssis/dts-to-ssis-migration/
    Map SSIS packages to databases: Good link to check
    http://www.experts-exchange.com/Database/MS-SQL-Server/Q_28340818.html http://www.sqlservercentral.com/Forums/Topic1531839-2799-1.aspx
    Map reports to databases -- Good link for Reporting Services if you meant that:
    http://msdn.microsoft.com/en-us/library/ms143747.aspx
    http://www.mssqltips.com/sqlservertip/2627/migrating-sql-reporting-services-to-a-new-server/
    Good link to check other thing as well :
    http://thomaslarock.com/2013/03/upgrading-to-sql-2012-ten-things-you-dont-want-to-miss/
    Santosh Singh

  • Problem with running a DTS package from CF Code

    i am using a CFQUERY Tag with EXEC dbo.storedprocname to
    execute a stored procedure on our sql server which runs a DTS
    package. the cf template allows them to upload a text file to the
    server for import to a sql table via this DTS package. the problem
    is that if the DTS package fails - it does nto notify the user
    runnign the CF template. is there any way to notify the user when
    the DTS package fails?

    well the size of the data file being import varies widely.
    the import is to be run daily but some days it might contain 10
    records and some days it might contain 10,000. the dts package
    itself generally takes a few seconds to process and the CF template
    takes around 5-10 seconds to complete.
    so if i were to add a dts task to the end of my work flow to
    update a table with a status message, that might work, but how
    would i capture the status of the dts import task?
    as for the asynchronous gateway, i don't think that would
    work for me, the user would want more immediate feedback, they
    would not wait for an email confirmation (the target users have
    trouble figuring out how to use email as it is - they are not the
    most computer savvy). so likely if i could get the dts package to
    write a status message to a table, then i would just add a cfquery
    to my cf template after the one that runs the dts package, and
    check for the status message and output it to the screen.
    but the key is how do i add a dts task to grab the status of
    the dts import task and drop it in a table.

  • How to modify DTS packages with minimal changes?

    Hello All,
    Our client have around 500 DTS packages. Each package loads the data in a file into SQL Server 2000 database. Due to some changes in thier transaction systems, now we will receive more than one file (as of now 2 files) with same structure (and different
    file name) that needs to be loaded into same table in SQL Server 2000. In the destination we are expected to add a new column which identifies from which file the particular record was loaded. Currently, the DTS packages have a configurator task which is configured
    with file name (using INI file).
    We are expecting to do this with minimal change in DTS packages so that the existing functionality is not affected.
    Please suggest me with some inputs to achieve this?
    Thanks in advance.
    Ganesh S

    AFAIK, only manual changes available in DTS for its packages being binary objects.
    Arthur My Blog

  • Content distribution issue with message "Found package properties updated notification for package '00000123'"

    I've got strange issue with 1 of my primary sites that started just recently.  I've updated the content of 1 package and this now needs re-distribution to all DPs.  I've got 3 primary sites and on 2 of those the update succeeded and my DP's got
    updated correctly.  One primary site it does not work and checking distrmgr.log I can see following message every xx minutes
    Found package properties updated notification for package '000008B7' SMS_DISTRIBUTION_MANAGER 6/21/2014 12:00:31 AM 5836 (0x16CC) ==> 
    Checking Pkgxfermgr.log does not show anything either,  I've tried with 2nd application but again the same result it only shows the the notification message.
    I saw similar issue yesterday but with restart of the sms_exec service it eventually distributed the content, obviously this is not something I like to do too often.
    does anyone have idea what this could be, suggestions are welcome.   Thx.

    Jason,  I've checked the flow from the CAS down to the primary below is quick overview.  The package I'm testing is just small package that we use to check replication is working in our environment it's less then 1MB in size and we run it
    1/week basically update content and then check monitoring-content distribution that it has been received on our 260 DP's around the globe
    CAS (Located in the US EST Time zone)
    Distrmgr.log 11:25am update package and needs to be send to 3x primary sites (A00; B00; C00)
    sender.log  11:30am all 3 primary sites have received the content.
    C00 (Primary site in Singapore having the issue)
    distrmgr.log 11:27pm received notification of the package
    despool.log   11:32pm packaged content extracted successfully
    distrmg.log started to see message Found notification for package '000008B7' and followed by next message
    Package '000008B7' (priority 2) is already in queue.
    This goes one until 1:21am (Singapore time)
    Start updating the package 000008B7... SMS_DISTRIBUTION_MANAGER 6/21/2014 1:21:45 AM 8296 (0x2068)
    The Package Action is 1, the Update Mask is 160 and UpdateMaskEx is 0. SMS_DISTRIBUTION_MANAGER 6/21/2014 1:21:45 AM 8296 (0x2068)
    Use drive G for storing the compressed package. SMS_DISTRIBUTION_MANAGER 6/21/2014 1:21:45 AM 8296 (0x2068)
    Successfully created/updated the package 000008B7 SMS_DISTRIBUTION_MANAGER 6/21/2014 1:21:45 AM 8296 (0x2068)
    STATMSG: ID=2311 SEV=I LEV=M SOURCE="SMS Server" COMP="SMS_DISTRIBUTION_MANAGER" SYS=SG-INTRA100.na.pg.com SITE=C00 PID=10132 TID=8296 GMTDATE=Fri Jun 20 17:21:45.848 2014 ISTR0="000008B7" ISTR1="" ISTR2="" ISTR3="" ISTR4="" ISTR5="" ISTR6="" ISTR7=""
    ISTR8="" ISTR9="" NUMATTRS=1 AID0=400 AVAL0="000008B7"
    After that nothing anymore.
    When I check monitoring - content distribution I can see the package being updated/distributed to 80% of my DP's and last 20% are the dp connected below this Primary site.
    To add to the confusion, there was another package distributed around the same time, and then one actually made it to the remote DP's.
    This is first time I see this issue.

  • SQL Agent job running DTS package running in SQL 2005 is unable to run if job onwer is not logged onto server

    I am currently working on a SQL Server upgrade project for a a client where I am converting old dts packages to SSIS. However for a few of the packages no conversion is allowed to be done. For these few packages I have to use dts legacy components in SQL
    2005 on a windows 2003 server to run them.
    These packages use CAPICOM via an Active X script in the package to envelope connection string data for security within the package. Consequently I have to register the capicom.dll for the job owner (which will execute the job via proxy) and install private
    and public key files via internet explorer. I also do this when I am logged in with my account so i can test the package.
    I have created a SQL Server Agent Job which is used to execute the package. We have a schedule account which is local admin on the server and sysadmin within SQL Server. This account is used to create a credential and then a proxy for the CmdExec subsystem
    is then created based on this credential. A CmdExec job step is then added to the job. The directory of  cmd file which calls the dts package is then entered in the command window.
    Finally a recurring schedule is added to execute the job every 5 minutes. 
    If i am logged in to the server using the scheduled account the schedule runs successfully. I am also able to run the command file manually by double clicking on it. The DTS package is run successfully. However once the schedule is set up and I log off the
    machine and log onto my development machine with my normal account and fire up  SQL Server. I connect to that instance with the schedule and see that the job is failing with and Active X error in the package. From experience with this package this Active
    X  error occurs when the user executing the package has not registered the capicom.dll. This has already been done for the scheduler account because the job runs when the scheduler account is logged in on the server. 
    It almost seems as though the job will only run if the Scheduler account is logged on. If i log directly on to the server with own user account I am able to manually execute the package via the cmd file which indicates that the capciom.dll is registered
    under my account. Yet if I try an run the job in SQL Server when I am logged in under my account (using the scheduler account proxy) then the job fails.
    Does anybody have any idea why this may be happening? Any ideas would be much appreciated

    Run the job SSIS step under a proxy account that is derived from the domain account, non-expiring password and has been set to have all the necessary rights.
    How to is here: http://www.mssqltips.com/sqlservertip/2163/running-a-ssis-package-from-sql-server-agent-using-a-proxy-account/
    Arthur
    MyBlog
    Twitter

  • Custom DTS package migration from BPC 4.2 ,SQL 2000 to BPC 7.0 M , SQL 2005

    Is there any changes required in the custom dts package when migration from BPC 4.2 , sql 2000 Environment to bpc 7.0 , SQL 2005/2008  Environment.
    or
    Please suggest process for migrating  custom dts package from BPC 4.2 ,SQL 2000 Envirnment to BPC 7.0 ,SQL 2005/2008 Environment

    When you say "custom dts package" that can mean many different things. What type of customization has been done?
    There are a few BPC-related features which changed from 4.2, which must be manually adjusted, if you're using those features.
    But SQL itself also changed dramatically in moving from SQL 2000 to 2005. So if your customer's packages are heavily customized around SQL 2000, this may require substantial re-work.
    The only migration process for custom DTS packages -- that I'm aware of -- is to use the SQL 2005 migration tool in SSIS, see how much it messed up, and then fix everything else that's still broken.
    But there also may be opportunities to improve the package overall. SQL 2005 has a lot of great new features in SSIS, over what was there in SQL 2000.
    I haven't started working with SQL 2008 yet, so I can't say what complexity there is in upgrading DTS packages from 2005 to 2008. From what I read in the BPC 7 release notes, it sounds like it's a very minor upgrade, compared to the jump from 2000 to 2005.

  • How to Import a DTS Package, while keeping version History in Destination Intact

    Hi Guys,
    Not sure if this is the right forum for my question. But I couldn't find any other DTS forum to post my query.
    Basically, I have my Production Environment in SQL 2008R2 and it contains few DTS [NOT SSIS!!!!] packages in Management > Legacy. One of those packages, Let's say is, 'PackageA.dts'.
    Now for the PackageA, we have versions of last couple of years (almost 11 versions we have for this package), recently in Test Environment (again, SQL 2008R2) we made Lot of changes to that Package and now we want bring that package from Test Env. to Production.
    But a) we prefer not to 'open it in Prod then make all individual changes one by one' rather we just need to kind of overwrite/replace our existing Production Package   b) also, we don't want to loose version  history for the Existing PackageA.dts
    in Production, so anytime we can rollback when required.
    Any Idea if I can? [Please don't post non relevant answer like, convert DTS to SSIS. Sorry if I sound rude, really will appreciate if some one can try helping me.]  
    Regards, Avik M.

    Hi ArthurZ... "...No deletions, just import, it overrides the prod package" --- Is that the
    case? If so, it could have resolved my issue I guess. But that's not happening...
    If I don't delete and try to import same named package, I get below error::
    TITLE: Object Explorer
    DTS Package 'PackageA' already exists with a different ID in this category. (Microsoft OLE DB Provider for SQL Server)
    Regards, Avik M.
    EDIT: Also, I found another Post : dts-package-already-exists-with-different-id-in-this-category which
    says, we need to basically delete the existing Package to import same named package. -- Just opposite of what you mentioned ArthurZ. So what's the conclusion?
    I need to understand why the same package that I'm bringing from a different server is not just creating a new version if that package name already exists?
    Any workaround Microsoft?

  • Error in DTS Package.

    Hello,
    Could any body help me to find solution to this below error:
    "This Version of DTS Package can not be Saved directly to the package.
      Please a dynamic script and as to EvDTSModify Task Script"
    Thanks,
    Satish.

    If you are using SQL 2000, you will need to modify the package via the SQL 2000 DTS editor.  The eData > Organize Package modification process will not work with the SQL 2000 DTS packages, only SQL 2005 SSIS packages.
    In the DTS editor, you will need to edit the EVDTSModify task to include the change you are attempting to make in the Advanced tab editor.

  • DTS packages

    I have migrated the DTS packages (which was running in SQL 2000 Server) to SSIS Packages (2008) (through
    Migrate 2000 DTS Package option in Visual Studio).
    The below is error I am getting when we execute the SSIS package in SQL Server 2008 R2 Server.
    Environment : SQL Server
    2008 R2
    Version : 64 bit
    Version
    Date  2/18/2015 5:10:15 PM
    Log  Job History (Oracle to Access - PROD)
    Step ID  1
    Server  CSVP000A1037\WWSHRD02
    Job Name  <TestJob>
    Step Name  Test Oracle to Access
    Duration  00:00:01
    Sql Severity  0
    Sql Message ID  0
    Operator Emailed 
    Operator Net sent 
    Operator Paged 
    Retries Attempted  0
    Message
    Microsoft (R) SQL Server Execute Package Utility
    Version 10.50.6000.34 for 64-bit
    Copyright (C) Microsoft Corporation 2010. All rights reserved.
    Started:  5:10:15 PM
    Error: 2015-02-18 17:10:16.42
       Code: 0x00000000
       Source: TEST_TABLE
       Description: This task does not support native Win64 environment. Please run the package in 32-bit WOW environment instead.
    End Error
    Error: 2015-02-18 17:10:16.42
       Code: 0xC0024107
       Source: TEST_TABLE
       Description: There were errors during task validation.
    End Error
    DTExec: The package execution returned DTSER_FAILURE (1).
    Started:  5:10:15 PM
    Finished: 5:10:16 PM
    Elapsed:  0.546 seconds
    The below one is the SQL script command which we have used in 2008 Server we are trying to execute through SQL Job scripts.
    @command = N'dtexec /ser servername\instancename /sq Oracle2Access_PROD', @database_name = N'', @server = N'', @database_user_name = N'', @subsystem = N'CmdExec', @cmdexec_success_code = 0, @flags = 0, @retry_attempts = 0, @retry_interval = 0, @output_file_name
    = N'', @on_success_step_id = 0, @on_success_action = 3, @on_fail_step_id = 0, @on_fail_action = 2
    I have set this package property Run64BitRunTime = False
     Please help me how to resolve the issue.
    Thanks,
    Vijay

    Hi Xiong,
    Thanks I have resolved the below after I have added the AD group name. But now I am getting a different issue while running the package.
    Exception as below:
    Message
    canceled by user.
       at DTS.PackageClass.Execute()
       at Microsoft.SqlServer.Dts.Tasks.Exec80PackageTask.Exec80PackageTask.ExecuteThread()
    End Error
    Error: 2015-02-20 16:30:13.35
       Code: 0x00000000
       Source: TBL_CODE_VALUE
       Description: System.Runtime.InteropServices.COMException (0x80040427): Execution was canceled by user.
       at DTS.PackageClass.Execute()
       at Microsoft.SqlServer.Dts.Tasks.Exec80PackageTask.Exec80PackageTask.ExecuteThread()
    End Error
    Error: 2015-02-20 16:30:13.36
       Code: 0x00000000
       Source: GRL_COLLECTION
       Description: System.Runtime.InteropServices.COMException (0x80040427): Execution was canceled by user.
       at DTS.PackageClass.Execute()
       at Microsoft.SqlServer.Dts.Tasks.Exec80PackageTask.Exec80PackageTask.ExecuteThread()
    End Error
    Error: 2015-02-20 16:30:13.37
       Code: 0x00000000
       Source: CTN_CONTAINER_TYPE
       Description: System.Runtime.InteropServices.COMException (0x80040427): Execution was canceled by user.
       at DTS.PackageClass.Execute()
       at Microsoft.SqlServer.Dts.Tasks.Exec80PackageTask.Exec80PackageTask.ExecuteThread()
    End Error
    DTExec: The package execution returned DTSER_FAILURE (1).
    Started:  4:30:00 PM
    Finished: 4:30:13 PM
    Elapsed:  12.558 second
    This is the Overview of this Work
    Overview
    I have migrated the DTS packages (which was running in SQL 2000 Server) to SSIS Packages (2008) (through Migrate 2000 DTS Package option in Visual Studio).There
    are no errors after migration The purpose of this packages are connecting to Oracle database and generate an MDB file in the share location.
    Please help me how to reolve the above issue.
    Thnaks,
    Vijay
    Overview
    I have migrated the DTS packages (which was running in SQL 2000 Server) to SSIS Packages (2008) (through Migrate 2000 DTS Package option in Visual Studio).There are no errors after migration The purpose of this packages are connecting to Oracle database and
    generate an MDB file in the share location

  • Need to convert DTS packages to SQL Server 2012 environment.

    Hi Friends,
    As Part of the Project Requirement,we need to convert DTS packages to SQL Server 2012 environment.
    Please sugest me best approach.
    Thanks

    Best approach is to re-design the packages in SSIS 2012 directy if it is feasible. Because most of the DTS feaures are discontinued and also you will have to clean up all errors that you are going to get after migration.
    Discontinued Integration Services Functionality in SQL Server 2012
    Otherwise you need to migrate it first to 2008R2 and then 2012 version.
    Below ones would be helpful for you:
    Migrate DTS packages to SSIS (SSIS2008R2)
    Support of DTS packages in 2008 R2
    Known DTS Package Migration Issues
    Cheers,
    Vaibhav Chaudhari

  • Package Properties file not Found SCC

    Hello everybody,
    i need some help i m having this issues : i can't access to my packages files deployed on the default domain it's shows me this error : "Failed to get the package List"
    i checked the domain log i found this error;
    Subsystem=Error  Application ID=, Application Connection ID=, User=, Correlation ID=, Package=, MBO=, Operation=, Thread ID=80, Node ID=WIN-1CMM6LM48GD, Error=com.sybase.djc.SystemException was thrown by transaction com.sybase.sup.server.sis.SISNotificationProducerTask.run()\ncom.sybase.djc.SystemException: Package properties file not found: d1_bapi_fl.1_0
              at com.sybase.sup.server.sis.SISNotificationProducerTask.run(SISNotificationProducerTask.java:233)
              at com.sybase.sup.server.sis.SISNotificationProducerTask_DJC.access$001(SISNotificationProducerTask_DJC.java:4)
              at com.sybase.sup.server.sis.SISNotificationProducerTask_DJC$1.invoke(SISNotificationProducerTask_DJC.java:25)
    thank's .

    treat .properties files just like a class file :)
    if /classes/ is in your classpath and in that directory you have an x.properties file then:
    ResouceBundle.getBundle("x");
    will return it...
    if the x.properties file is in the /classes/com/company/props/ directory then this will act like a package name and
    ResouceBundle.getBundle("com.company.props.x");
    will return it ;)

  • Sql insert in Java vs. sql dts package

    Hi,
    I was wondering the speed difference between inserting records to database from Java as oppose to inserting records using a sql server dts package. I'm talking about 3000+ records.
    See Java when inserting records to database it looks something like this:
    while (recordHasNext)
       String insertStr = "insert into table(item) values(" + valueVariable + ")";
       statement.executeQuery(insertStr);
    }where as if I'm executing a dts package I would create a .bat file with the following commands:
    DTSRUN.EXE /S ServerName /E /N PackageName /F FileName
    And then have Java execute the batch file.
    So my question is, which is faster for the amount of records I'm inserting?
    thanks,

    veryConfused wrote:
    Hi,
    I was wondering the speed difference between inserting records to database from Java as oppose to inserting records using a sql server dts package. I'm talking about 3000+ records.That's not many.
    >
    See Java when inserting records to database it looks something like this:
    while (recordHasNext)
    String insertStr = "insert into table(item) values(" + valueVariable + ")";
    statement.executeQuery(insertStr);
    }where as if I'm executing a dts package I would create a .bat file with the following commands:
    DTSRUN.EXE /S ServerName /E /N PackageName /F FileName
    And then have Java execute the batch file.
    So my question is, which is faster for the amount of records I'm inserting?
    thanks,Measure it for your situation and see.
    My recommendation would be to go with DTS. They have a graphical way of mapping from one database to another, including transforms. You don't have to write code to do it. And I'd bet that DTS will do it faster, but I'm not certain.
    %

  • Calling DTS package from Stored Procedure

    I am getting error calling DTS package from CF.
    So i want to call DTS package from SQL Server Stored
    Procedure.
    DTS package create text file. So no need of input or output
    parameter.
    What is the syntax?.
    thanks for ur help.

    Ted Kruger explains how this can be done in his blog post
    Run SSIS Package from Stored Procedure
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog

Maybe you are looking for

  • How would i know if my battery is DEAD

    i have a c6 phone and it has a major sickness not even key shortcuts can turn it on so can anybody tell me if i were able to take my battery out of my phone while charging will it die like it wont be able to work at all like its dead because i took m

  • Can't get X11 to load, hard crashes with Geforce 8200M

    I can't get Xwindows to load on a new laptop I recently got. Ubuntu Live 64bit works fine, even can install the NVIDIA drivers and get 3D support on it (tested this before I purchased the laptop). So in Arch Linux (64bit) I downloaded the main NVIDIA

  • When I insert photos into Premiere Elements timeline they become pixilated.  Has anyone a remedy?

    The photos I insert into the timeline in Elements become pixilated.  They looked fine in the organiser.  Has anyone a remedy to this problem please?

  • Return on Closed WO - Best Practice

    Hi All, We have a work order which is closed in Jan 2014. We have closed our accounting periods also. We need to do a reversal on this transaction. What is the best practice in industry? Thanks in advance. Regards, N

  • ComboBox hell

    I am trying to write code that will check whether the date entered by the user is valid. The following code works but only with the first month chosen e.g. if the user selects 31 Feburary the correct Dialog box will be displayed. I would like it so t