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

SORT to remove duplicates does not work

$
0
0

I am using a sort task to remove duplicates, however when it writes to the database I believe it is adding the rows from the duplicates and not subtracting the rows. I am reading data from a table, sorting by one field Tag_Name, and checked remove duplicates, it removes duplicates but when I write back to OLED DB Destination, and look at table it appears to ADD the duplicates??




Greg Hanson


Reading Excel Cells and converting it into text file

$
0
0

Hi All,

I have a requirement in which the task is to read data from .xls file and put it into a text file. The SSIS should read data from Excel cell A:4 to L:15. Only the data highlighted in Yellow should be loaded into text, other data in the excel should not be loaded into text file.

Any help would be greatly appreciated.

I am using SSIS 2008R2

I have attached the input file(Excel Sheet) and also i have attached the expected output file(Text File).

Thanks

Syed

Input File

OutputFile



Get error from SQL AGENT: The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D024

$
0
0

I am running SQL Agent that executes an SSIS process from sql server1. The SSIS process executes its SQL/tables/sp’s  against another sql server2.

I get an error after adding data flow tasks with transaction supported within a sequence with transaction required. The error, “The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D024 "The transaction manager has disabled its support for remote/network transactions"

Prior to adding this sequence everything was working from sql agent, and there were other sequences with oledb destinations.

Everything works when running within SSIS Package.

I see this article on similar issue, https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0bfa2569-8849-4884-8f68-8edf98a9b4fe/problem-to-execute-a-package-and-tasks-with-a-certain-transactionoption-property-i-need-help?forum=sqlintegrationservices

“I had similar issue and solved by setting the following on both the machines. Allow Remote Clients, Allow Remote Administration, Allow Inbound Clients, Allow Outbound Clients, and TIP are enabled in Component Services/My Computer/Properties/MSDTC/Security Configuration.”

I don’t want to remove transaction required for the “Remove Duplicates from Staging” sequence.

Anyone seen this?


Greg Hanson

ORA-00904 Invalid Identifier error

$
0
0

Good Morning All,

I have a small sql code that works fine in sql developer, but when i'm using it to load data (source Oracle db), destination (SQL Server). Its giving the error ORA-00904 Invalid Identifier SYSDATE, Any ideas? what i'm doing wrong here.

select first_start_datetime
from TABLE
where first_start_datetime>=sysdate

Thanks

MSORA and MSTERA data sources missing in Visual Studio 2012 / SQL Server 2014

$
0
0

Hi,

I'm building a brand new SQL Server 2014 environment to migrate existing production to. It's a fresh build with the detailed component versions shown at the end of this post. The problem that I am running into is that in an SSIS project, Visual Studio does not show the MSORA and MSTERA connection managers. Similarly, there is no sign of the Attuninty data sources.

I've tested the Oracle and Teradata clients and I'm pretty certain that they're installed correctly.  Going into the registry, I can see both the 64- and 32-bit entries for Oracle Home under HKLM\Software. For Attunity, I/m using the 3.0 adapters and I can see the expected 64- and 32-bit entries under HKLM\Software for software settings and registrations.    

I should mention that we are actively developing software on SQL Server 2008 and 2012 servers that use the Attunity Oracle and Teradata adapters for SSIS. No interoperability problems with those earlier versions.  I'm wondering if the issue might be with Visual Studio or SSIS.  Has anyone run into anything similar?

Build info:

OS Windows Server 2012 R2 Standard.  Includes KB2919355 - Windows Server 2012R2 Update

SQL Server 2014 - 12.0.2342.0 (X64) CU1

Oracle 11gR2 Clients - 64 & 32-bit

Teradata CLIv2 nt-x8664 14.10               
Teradata Data Connector nt-x8664 14.10      
Teradata GSS Client nt-x8664  14.10        
Teradata OLE DB Access Module nt-x8664 14.10    

Microsoft Visual Studio 2012 Shell (Integrated)
    Version 11.0.50727.1 RTMREL
    Microsoft .NET Framework
    Version 4.5.51641

    Installed Version: IDE Standard

    Microsoft Visual Studio Tools for Applications 2012   04932-004-0017006-02028
    Microsoft Visual Studio Tools for Applications 2012

    Visual Basic 2012   04932-004-0017006-02028
    Microsoft Visual Basic 2012

    Visual C# 2012   04932-004-0017006-02028
    Microsoft Visual C# 2012

    SQL Server Analysis Services   
    Microsoft SQL Server Analysis Services Designer
    Version 11.0.3436.0

    SQL Server Data Tools   11.1.41025.0
    Microsoft SQL Server Data Tools

    SQL Server Integration Services   
    Microsoft SQL Server Integration Services Designer
    Version 11.0.3436.0

    SQL Server Reporting Services   
    Microsoft SQL Server Reporting Services Designers
    Version 11.0.3436.0

diagram position

$
0
0

Hi we run 2012 std.  The answer at https://social.msdn.microsoft.com/Forums/en-US/a66422ca-3453-47c1-87ec-c8d79ce59b48/upper-left-justifying-components-of-your-package-in-designer?forum=sqlintegrationservices was great for one of our pkgs whose ui diagram "roamed" but not great for another one.  

I'm not sure why diagrams roam away from upper left corner and why sometimes they cant simply be dragged as is back to where the next programmer will see them immediately when he opens the designer but we have one that has roamed, wont be dragged in a cooperative way (perhaps cuz a vm is involved) and gets completely shuffled if we choose format->auto layout-> diagram.

Is there a tag inside the dtsx's xml that can be manually set to reposition such a pkg's gui diagram?  Or some other  alternative?

Unexpected Termination SSIS package - Issue with SSIS packages after upgrading to SQL Server 2014

$
0
0

Hello everyone.

We performed an upgrade of SQL Server 2012 installation to SQL Server 2014 (with last CU5 update). We found that all SSIS packages (even the simplest with just Execute SQL tasks) fail with Unexpected termination message. The issue reproduces with both new packages (that are created from scratch with SSDT 2014) and old packages (migrated from SQL 2012).

Any ideas, please? We googled and found that it is a known issue that should have fixed with CU4. But we use CU5 and the issue is still here.

Cross-posted to: https://social.msdn.microsoft.com/Forums/en-US/45d13481-9890-4fa3-b7ac-c893bfd3eea9/unexpected-termination-ssis-package-issue-with-ssis-packages-after-upgrading-to-sql-server-2014?forum=sqlsetupandupgrade


MCP

Lookup transformation

$
0
0

Hi,

I am working on a package to transfer data from database to an application. I used lookup transformation to filter match data and no match data. I've forwarded No Match data to my application so that when I update I don't create duplicates.

Now I have Match data which I configured to send it to an Excel destination. But that data is of no use to me. I want to get rid of Match data instead of sending it to Excel sheet. What is the best practice to achieve this kind of scenario?

Thanks


Loop through excel file sheets in ssis

$
0
0

HI..

I have one excel file which is having dimensions meta data info in each sheet (One dimension info in each sheet) with same format. Sheet name having the dimension name.

Now, i want to access these sheets and load into my target table(look up on sheet name and target table name).

So, i need to perform 2 tasks now.

1) Loop thru all sheets in excel and

2) Save the sheet name in variable each time, using this variable to look up on target table name .

Can anyone help me to achieve this?

Increment variable in Script Task

$
0
0

I have a variable called varChangeVersion of type Int32 and package level scope and a default value of 0. 

I am using a Script Task to increment this variable by 1 each time the SSIS package runs (line 1). I am using the get current version line for debugging purposes.

I have added the varChangeVersion variable to the ReadWriteVariables list.

If I run run the package I can see the varChangeVersion always changing to 1.

It does not seem to be writing the new version. What I expect to see is an increment of 1 each time the package runs so 0, 1, 2, 3, 4 etc.

Am I missing something?

Using Union in Execute SQL Task

$
0
0

I am using the following SQL statement in an Excute SQL Task:

declare @RespAreaSubAreaID int, @UserLevelID int, @SubmittedByUserID int, @RespAreaID int, @SubAreaID int
Set @RespAreaSubAreaID = ?
Set @SubmittedByUserID = ?
Set @UserLevelID = ?
set @RespAreaID = ?
set @SubAreaID = ?

select users.User_EmailAddress + ';' As CC
                  from users inner join UserLevelsNotificationFrequencys on users.user_Id = UserLevelsNotificationFrequencys.User_id
                  where UserLevelID =  @UserLevelID and RespAreaSubAreaID = @RespAreaSubAreaID and (NotificationFrequencyID = 4 and users.user_id <> @SubmittedByUserID)
            union
            select users.User_EmailAddress + ',' As CC
                  from users inner join UserLevelsNotificationFrequencys on users.user_Id = UserLevelsNotificationFrequencys.User_id
                  where UserLevelID = @UserLevelID and RespAreaSubAreaID = @RespAreaSubAreaID and (NotificationFrequencyID = 1)

 I have my parameter mapped correctly. My results set is set to xml because I want it all in one string to use as a variable named User:CC. On the Result Set tab the result name is 0 and the variable name is User:CC. When I run my package I am getting the error below. Can I not do a union query in the execute SQL task? I tried to not declare anything and just map to each of the variables that I am passing in the order that they are needed but that didn't work either. Thanks in advance for your help in this matter.

 [Execute SQL Task] Error: Executing the query "declare @RespAreaSubAreaID int, @NotificationID in..." failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.


Reach for the unknown!

Export AD columns in SSIS

$
0
0

I know there are a lot of topics related to this: I know about setting up an ado.net connection. I just can't seem to put together statements to do this simple export which would enable to be to totally automate an ssis job I wrote: I want to get those two fields (ID and name) to export to a file. 

Script component runtime error

$
0
0

I have a  package to update and create contacts from a database to an application. So far it is working fine. But if one of the input columns has null value it throws this error:

Condition for attribute 'new_lapinterpreter.new_interpreterlanguage': null is not a valid value for an attribute. Use 'Null' or 'NotNull' conditions instead.


I've used lookup transformation to avoid duplicate insertions and mapped the columns accordingly.

Here is my code:

public override void ContactInput_ProcessInputRow(ContactInputBuffer Row)
    {
        bool hasDulicate = false;
        FilterExpression codeFilter = new FilterExpression(LogicalOperator.And);
        codeFilter.AddCondition("new_interpretername", ConditionOperator.Equal, Row.fullname);
        codeFilter.AddCondition("new_interpreterlanguage", ConditionOperator.Equal, Row.newprimarylanguage);
        codeFilter.AddCondition("new_emailintlap", ConditionOperator.Equal, Row.emailaddress1);
        codeFilter.AddCondition("new_primaryphoneintlap", ConditionOperator.Equal, Row.mobilephone);

        QueryExpression query = new QueryExpression
        {
            EntityName = "new_lapinterpreter",
            ColumnSet = new ColumnSet(true),
            Criteria = codeFilter
        };
        EntityCollection records = _orgService.RetrieveMultiple(query);
        int totalrecords = records.Entities.Count;
        foreach (Entity record in records.Entities)
        {
            if (record["new_interpretername"] != null)
            {
                record["new_interpretername"] = Row.fullname;
            }

            if (record["new_interpreterlanguage"] != null)
            {
                record["new_interpreterlanguage"] = Row.newprimarylanguage;
            }

            if (record["new_emailintlap"] != null)
            {
                record["new_emailintlap"] = Row.emailaddress1;
            }

            if (record["new_primaryphoneintlap"] != null)
            {
                record["new_primaryphoneintlap"] = Row.mobilephone;
            }
            _orgService.Update(record);
            hasDulicate = true;
        }

        if (hasDulicate == false)
        {
            var contact = new Entity("new_lapinterpreter");

            if (!Row.fullname_IsNull)
            {
                contact["new_interpretername"] = Row.fullname;
            }

            if (!Row.newprimarylanguage_IsNull)
            {
                contact["new_interpreterlanguage"] = Row.newprimarylanguage;
            }

            if (!Row.emailaddress1_IsNull)
            {
                contact["new_emailintlap"] = Row.emailaddress1;
            }

            if (!Row.mobilephone_IsNull)
            {
                contact["new_primaryphoneintlap"] = Row.mobilephone;
            }


          _orgService.Create(contact);
        }
    }

Thanks

Why are SSIS sendmail attachments read only

$
0
0

I am sending different attachments with my SSIS sendmails, but when I click on them they are always read only and cannot be changed as is. Is there any way to change that?

Changing Excel Worksheet Names To Ensure Continuity

$
0
0

Hello, everyone!

I had an SSIS package that would import the contents of a single sheet Excel file, massage the data and dump the results into a SQL table.

I used an Excel Source tool to set up the template, and it has a set value for the name of the specific worksheet to access. This worked fine for my original source files - every Excel workbook had the working sheet named, "Report." But, I need to adapt this package to work with Excel workbooks from another vendor and, rather than a fixed name for the relevant worksheet, they use a combination of the month and day; so, "02.09" for Feb 9th, rather than, "Report."

This means that as I receive the daily report, the worksheet name changes thus, "02.09," "02.10," "02.11," etc. But, I need the name to remain constant so that the template can be used.

Now, I know it's possible to change the worksheet names using vBasic in a macro from within Excel, but is there a way to do it from outside? I'm thinking that I could run a script task to modify the worksheet names for each daily report before importing them for massaging, but I don't know how to do it, if that's even possible from outside Excel.

Or - and, this'd be nice - is there some sort of mechanism in SSIS to change the worksheet names? Or - this'd be even better as it would save a few steps - is it possible for SSIS to use a dynamic name for the worksheet in the Excel Source Editor?

Any ideas?


SSIS 2012 continuous integration using msbuild

$
0
0

Hi,

I have an SSIS 2012 project file *.dtproj. I want to create .ispac file from a program for continuous integration. I saw posts saying we cannot do it using msbuild. What are the other options? Has anyone used ssismsbuild (sqlsrvintegrationsrv codeplex)

I am very new to .NET and SSIS. Any example or step by step instruction to achieve this is highly appreciated.

Thanks,

Rajesh

Send Mail Task in SSIS Weird errors

$
0
0

Hey there all, 

 

i am having a weird problem with the send mail task in SSIS.  I have tried to different things, and i end up with two different errors:

 

Firstly, i have setup a data dump to excel, and the send mail taks emails this to specific email addresses. 

In the Send mail task i have validated to SMTP server, and its correct. 

I have manually entered all the information in the Send mail task, and i am sending to multiple email addresses.  These are all seperated by a semi colan.  I run the task and it fails on the send mail task with the follwoing error:

Error: 0xC002F304 at Send Mail Task, Send Mail Task: An error occurred with the following error message: "Unable to send to all recipients.".

Task failed: Send Mail Task

I have validated all the email address and they are correct.  I did some searching and someone suggested to replace the semi colan with a comma. I do this and i get the follwoing error"

Error: 0xC002F304 at Send Mail Task, Send Mail Task: An error occurred with the following error message: "Mailbox unavailable. The server response was: 5.7.1 Unable to relay for rpwallis@bigpond.com.au".

I have checked that the IP for the SQL server is on the list of allowed relays on our exchange server.  Does it make a difference if i am running this from Visual studio on my laptop?? by this, does it pick up the ip of my laptop when i test this or does it use the ip address of the server??  This would explain the relay message error if so..

 

Could someone please explain if i should use comma's or semi colans to seperate email addresses?  and also lead me in the right direction in relatio to my problems..

 

Many thanks in advance

 

Scott Lancaster

combine text files using SSIS

$
0
0

I have 5 text files with name 1.txt, 2.txt, 3.txt, 4.txt and 5.txt.

1.txt contains

abc

def

2.txt contains

ghi

jkl

and so on

I m looking for one output file with all these files combined so my output looks like

/*************Start of Page 1************************/

abc

def

/************end of page 1*************************/

/*************Start of Page 2************************/

ghi

jkl

/************end of page 2*************************/

so on till end of page 5.

How do we achieve this using SSIS .

any help much appreciated.

Thanks.

SSIS Order by not working

$
0
0

Good Morning Friends,

I'm just running a package that loads data from the source into destination. The requirement is the load should be sorted. I'm using sql command and doing ORDER BY. I went to the advance editor and changed the IsSortable property to TRUE, made the column sort key position 1. When i build the query it works fine. When i load the data into the destination table its sorting by the PRIMARY KEY (AdmissionRate_id). Any ideas what is wrong?

SELECT     AdmissionRate_ID, FacilityHoursType,  Rate
FROM         MYTABLE

ORDER BY FacilityHoursType ASC, Rate DESC


SV

SQL Server Parameter Issue In Job

$
0
0
I  have a SQL job that runs the exact same package three times with different configuration values connecting to different servers. On the third time the package runs I get the error

Environment reference Id: NULL. Description: The parameter 'Client' does not exist or you do not have sufficient permissions. Source: .Net SqlClient Data Provider Started: 3:16:03 PM Finished: 3:16:03 PM Elapsed: 0.203 seconds. The package execution failed. The step failed.

This error happens in less than one second and I don't have a parameter Client in my SSIS package, job configuration parameter or in the configuration of the Integration Services Catalog.

Has anyone seen this error? What I am primarily wanting to hear is suggestions on where else to look for this parameter?

Viewing all 24688 articles
Browse latest View live


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