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

SSIS reusable transformations

$
0
0

Hi,

I am using SSIS 2015.   

I have a table which has 30 DATE columns. I want to apply transformation logic on these date fields. the logic is same but it has to be applied on all 30. Instead of writing the code again and again in derive transformation expression 30 times, is there a way to write kind of function, which when called by passing my date field as parameters returns me the expected result.

similar to this I have transformations for multiple data types. So is there a way to write re-usable transformation expression in SSIS

Thanks 


Issue with Excel Destination Mapping

$
0
0

Hi,

I am facing a very strange issue with some of my packages which have same structures.

The packages are for reconciliation of the data, for this I am select data from Source & Destination and after applying required transformation I am writing the data in an Excel Destination. There are header templates for this Excel Destination. Whenever I run the package a new excel is created, headers are copied from the template file and then data is written into the new excel file. A macro's code is written in this excel which compares the data between Source and Destination. This is the architecture we follow across all the recon packages.

Issue -

The packages run perfectly fine on my machine, I then check in the code on GIT repo through Tortoise GIT tool. When my colleague gets latest package and tries to run the same on his machine, the package fails. Error looks like the mappings in the Excel Destination is missing. The path for packages and templates are exactly same as mine.

There is an expression on Excel File path in Excel Connection.

Can someone please help me on this issue.

Please let me know in case you need any more details

I appreciate your help


Sandeep Prajapati

Package SSIS semms to be running but he is not

$
0
0

'm using Visual Studio 2015 I have Create a SSIS project from visual studio 2015 and  I have problem with my SSIS package. When I'm trying to debug it I get information "Package execution completed. Click here to switch design mode, or select stop debugging from the debug menu", and in Execution Results i got just blank page  . And on my flow there in no task with green mark indicated that task is completed correctly, no task with red mark indicated that task is completed with error and no task with yellow mark indicated that task is in progress. Do You have any ideas what could be the reason? Or is there any log where error could be explain in more details? Thanks in advance! 

SSIS OLED Source unicode error when connecting to Oracle Source

$
0
0

Hi Guys

I am encountering a strange issue with SSIS connecting to Oracle

I am creating a new SSIS extract which is connecting to a oracle source using Oracle Provider for OLEDB connection manger. When I configured OLEDB data source to consume a table data from Oracle -->  clicked OK, I started seeing the Error on the OLEDB Source reporting an Unicode conversion issue. I am not even tried mapping the source to a flat file and still seeing the error on the source.

I am NOT allowed to use data conversion tasks (Which is resolving the issue), as the package is supposed to run every one hour.

Can this be resolved by any configuration or installation changes.

Any help greatly appreciate.

Thank you


Execute Sql Task Generate SQL XML String but runs very long in SSIS but not SSMS

$
0
0

Good day,

Execute Sql Task Generate SQL XML String but runs very long in SSIS but not SSMS

I generate a 1 row XML string result in SSMS in 15sec but when i insert in Execute SQL task that store the result to a string variable it runs for 10min

I have Tasks that generates the XML string as the result in SSMS less than 10sec but this specific one just doesnt finish as SSMS qry and its the exact same thing i do for the other xml tasks

Only difference is the file at the end when generates is much bigger but this hangs before writing the output string to file, it hangs by the sql part writing result to var string. Also this result has more desired xml rows but in sql its 5sec

Please any help?

Question on setting a TLS 1.2 value within a SSIS package when connecting to Vendor's URL using a Web Service Task

$
0
0

We've been connecting to a vendor, Heartland, using a web service task in SSIS to consume our data and bring it down and insert the data into a SQL server table.

This last Wednesday, they upgraded their environment to only accept TLS 1.2 protocols and gave us no notice.  Unfortunately, we can no longer send a request as our connection is immediately closed.

We've been working to find a solution to help us use a TLS 1.2 value within our SSIS package as we cannot make a change on the SQL Server or OS to use the TLS 1.2 protocol because other apps are using TLS 1.0 and TLS 1.1.  

We're working on SQL Server 2014 and SSIS 2013.  Our understanding is that TLS 1.2 is enabled in these environments by default.  But I'm not finding that to be the case.  When I look at the value of this class:  System.Net.ServicePointManager.SecurityProtocol in my C# script were I try to set a TLS value for the security protocol I see Ssl3 | Tls in the AUTOS window.  And when I change the value of the protocol I see Tls12 value.  Then I execute my web service task and get this error:

[Web Service Task] Error: An error occurred with the following error message: "Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebserviceTaskException: The Web Service threw an error during method execution. The error is: The underlying connection was closed: An unexpected error occurred on a send..
   at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebMethodInvokerProxy.InvokeMethod(DTSWebMethodInfo methodInfo, String serviceName, Object connection)
   at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTaskUtil.Invoke(DTSWebMethodInfo methodInfo, String serviceName, Object connection, VariableDispenser taskVariableDispenser)
   at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTask.executeThread()".

Any suggestions on a work around?  Any help/direction would be appreciated. Thanks.

On SQL server 2016 Standard Edition the Maintenance Cleanup Task does not delete old text files (report files)

$
0
0

The maintenance task backs up the db and deletes any backup files older than 7 days successfully. However it should also delete the Maintenance Plan text reports after 7 days and it doesn't. The report indicates all the tasks complete successfully.

I've tried running an SQL Query (generated from View T-SQL) seperately and even though the message generated indicates the Command completed Successfully, the older text files still remain. Any idea on what could be causing this?

The T-SQL command is

EXECUTE master.dbo.xp_delete_file 1,N'H:\DailyDBBackups',N'txt',N'2018-06-29T13:11:37',1

NOTE: In the Maintenance Cleanup Task for the Maintenance Plan text reports the file extension specified is txt and "include first-level subfolders" is ticked.

Any help with a solution to this would be greatly appreciated. I'm tearing my hair out!!!

SSIS Job failed: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host, A connection cannot be made. Ensure that the server is running.

$
0
0

Hi All,

one of my Production SSIS job is failing with the below error. All of the required permissions are given for the account as far I know.

Some details of the environment: Windows Server 2008 R2, SQL Server 2008 R2 SP3, Disabled Win Firewall, Symantec Endpoint Protection

Microsoft (R) SQL Server Execute Package Utility
Version 10.50.6560.0 for 64-bit
Copyright (C) Microsoft Corporation 2010. All rights reserved.
 
Started:  6:21:40 PM
Error: 2018-07-04 18:22:46.21
   Code: 0x00000000
   Source: Process Full Process Full
   Description: An existing connection was forcibly closed by the remote host
End Error
Error: 2018-07-04 18:22:46.23
   Code: 0x00000000
   Source: Process Full Process Full
   Description: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
End Error
Error: 2018-07-04 18:22:46.23
   Code: 0x00000000
   Source: Process Full Process Full
   Description: A connection cannot be made. Ensure that the server is running.
End Error
Error: 2018-07-04 18:22:46.23
   Code: 0x00000008
   Source: Process Full 
   Description: The script returned a failure result.
End Error
DTExec: The package execution returned DTSER_FAILURE (1).

 Thanks!


setting a parameter in a ssrs 2012 report but getting an rsUnknownDataSetParameter using a shareed dataset

$
0
0

here is the error 

I seem to have the parameter defined correctly , right case and everything what could I be missing?

An attempt was made to set a data set parameter 'Department' that is not defined in this data set. (rsUnknownDataSetParameter)


date range

$
0
0

Hi,

I need to have the query to get the date range between now and 5 business days later (not include the weekend).  I am not sure how to do it, can you please help.

select * from tbl

where shpdate between ???

Thanks

DLL Certificate Issue Or Access issue in .Net framework or SSIS Package

$
0
0

Hello Everyone,

I am facing an issue while doing server migration from an existing server to a new server.
All my jobs are running fine except for one.
This job is is trying to run a SSIS package, which is having a script task in it.

That script task is referencing an external dll (Already installed in GAC)

I am getting following error message, when trying to run that package from job:

Installation of the certificate failed. Message:Access is denied.     Source:System   StackTrace:   at System.Security.Cryptography.X509Certificates.X509Store.Add(X509Certificate2 certificate)     at Foss.Mosaic.Foundation.Infrastructure.Certificates.CertificateManager.InstallCertificate(X509Store store, X509Certificate2 certificate)

Anyhow,  The job runs fine when an admin credential is provided, that too for next next one hour.
Then I need to again login to the RDP with admin credentials.
This was not the case in old server, the job was running fine there.

Can anyone please help, I tried many options but still no luck :(

Sorry, If I am not clear & please let me know for any question.

Deployed Project not importing CSV file Data

$
0
0
I have a project with an Execute SQL Task (Which truncates the temp table when the project is run), a Foreach Loop Container which contains a Data Flow task to import the results of CSV files into the temp table. I then have outside of the Foreach Loop Container, a Script Task that deletes the CSV files from a specified folder directory. When I run the project in debug mode, it works perfectly. The temp table is truncated, the results of multiple CSV files is imported into the Temp table, and the CSV files are deleted. However, when I deploy the project and create a SQL Agent Job, the truncate table task runs as well as the Script task that deletes the files. But there is no data that is imported. It's as if the Data Flow Task inside the Foreach Loop Container does nothing. Any ideas? I'm using 2012.

Unable to connect to webservice

$
0
0

Dear Experts,

I have to consume web service through SSIS(Web service task) I can browse the WSDL they shared, but there is an issue that "host name" and "Certificate name" do not match just because of that in SSIS I am getting below error:

"The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."

I want to ignore/ bypass that error, any suggestion please

-Muhammad Masood

Data Duplication

$
0
0

 I have a requirement as below.

I have a table and want to identify the duplicate records and find out the winner records and loser records based on the below criteria and insert the loser records into a different table with parentid info .

Criteria as follows :

  1. SSN Match AND (Phonetic Last Name Match or Phonetic First Name Match) In this condition, the SSN should match and there is a phonetic match between either First Name or Last Name. Then max cust_no will be the owner

  2. DOB Match AND (Phonetic Last Name Match or Phonetic First Name Match) AND SSN Match (If not NULL) In this condition, there is a phonetic match between First Name or Last Name and Date of Birth must match and if SSN is not null, then SSN should also match. Then max cust_no will be the owner

  3. DOB Match AND (Phonetic Last Name Match and Phonetic First Name Match) AND SSN is NULL In this condition, there is a phonetic match on First Name and Last Name, Date of Birth must match and SSN must be null. Then max cust_no will be the owner

sample records

Scenario 1 First Name Last Name SSN DOB CUST Id Comments Record 1 John Houy 123 null 10 Duplicates Record 2 Jon H 123 1/1/2001 5

Record 1 John Houy 123456789 null Not Duplicates Record 2 Anna Murrey 123456789 null

Scenario 2 First Name Last Name SSN DOB Comments Record 1 Anna Murrey null 1/1/2001 Duplicates Record 2 Ana Murey null 1/1/2001

Record 1 Anna Murrey 123456789 1/1/2001 Not Duplicates Record 2 Ana Murey 987654321 1/1/2001

Record 1 Anna Murrey 123456789 1/1/2001 Duplicates Record 2 Ana Murey null 1/1/2001

Record 1 Anna Murrey null 1/1/2001 Duplicates Record 2 Ana Mary null 1/1/2001

Scenario 3 First Name Last Name SSN DOB Comments Record 1 Jon Houy null 1/1/1969 Duplicates Record 2 John Hoy null 1/1/1969

Record 1 John Trovolta null 1/1/1969 Not Duplicates Record 2 Jon To null 1/1/1969

I'm planning to use a T-SQL (stored procedure) or SSIS Can anyone please help me to achieve it.

Thank You

SSIS Failed to Start after Protection Level Changed

$
0
0

I had a SSIS project which by default used EncryptSensitiveWithUserKey as Protection level. Due to security purposes and the fact that the proection is being manipulated by my new co-workers I need it to use EncryptSensitiveWithPassword. But when I changed the setting, both in the Project and Package properties, next time I try to debug the project within Visual Studio it gives this error message as soon as I click start...

Exception deserializing the package "The package failed to load due to error 0xC0011008 "Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.". This occurs when CPackage::LoadFromXML fails.
". (Microsoft.DataTransformationServices.VsIntegration)

Help!


Remove Intermittent Quotation Marks From Flat File

$
0
0

I need to import a text file we receive from a vendor. Unfortunately, the vendor sends a somewhat messed up file. The file is comma delimited, which is no big deal. But, the file sprinkles quotation marks throughout the file, and it's not consistent. Not every column has quotation mark qualifiers. Here's an example:

Canada,abc-123, "VP, Technical operations", 123-XYZ, "some text, more text", last column

So in this example, there should be six columns, but when using SSIS flat file connector, no matter what you do, it will actually see eight columns - splitting "VP, Technical Operations" and "some text, more text" both into into two columns each - totaling eight columns.

I would like to remove the double quotes and change the column identifier to a pipe instead of a comma. 

I found the following blog post, but it doesn't really fill in some gaps - like the first step. How do you get SSIS to "see" an input file as one gigantic row??

http://geekswithblogs.net/Compudicted/archive/2011/09/19/ssis-how-to-remove-occasional-quotes-and-replace-the-column.aspx

Is anyone aware of another way to accomplish this? If not a different way, could you provide a littler more detail on how to get this to work?

Thanks in advance!


A. M. Robinson

SSIS Get the highest ID number and assign ID to the next records

$
0
0

Hello

I'm developing a data warehouse for a vet treatment database.

I need to assign an ID column when a Pet has stayed in Hospital.

In SSIS I need to get the max ID from the ID column, which I know how to do. I thought I would run a Max SQL script and assign it to a Variable.

How do I take that Variable and add one for each record for each Pet that has stayed in Hospital?

Regards

SQLSearcher99 

SSIS Package taking hours to complete

$
0
0

Good Morning All,

We have an SSIS package and its taking hours to complete. There is on data flow task which is just a query based off 4 tables and it takes long time to render results. One table in particular is taking forever when all i did was count

select count(*)

from latetable.

I looked up and it has indices , can someone please tell me where to start looking?

Thanks

Dynamic configuration file name in select configuration type

$
0
0

I have created a package.  I have setup dtsconfig  file under

1. Package configuration wizard

2. select configurationtype = xml configuration file

3. Specify configuration settings directly

3a. Configuration file name = "C:\a\b\a.dtsConfig" 

This file consists of servername. When I move this package to QA, i see there we have a different path like "D:\a\a.dtsConfig". Due to this, am getting an error saying pathC:\a\b\a.dtsConfig not valid. How do I get / set path dynamically in "Configuration file name" text box? 

Upload files to share point without credentials stored in the package

$
0
0

I have few ETLs that upload files to share point using a script task(VB code). My code looks like:

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.IO
Imports System.Net<Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute()> _<System.CLSCompliantAttribute(False)> _
Partial Public Class ScriptMain
    Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase

    Enum ScriptResults
        Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success
        Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
    End Enum


    Public Sub Main()
        ' Script entry-point, this will simply set the file variables
        ' then call a sub-routine to transfer the file
        Try
            Dim localFile As String = CStr(Dts.Variables("SPSourceFile").Value)
            Dim remoteFile As String = CStr(Dts.Variables("SPDestFile").Value)

            UploadDocument(localFile, remoteFile)

            Dts.TaskResult = ScriptResults.Success
        Catch
            ' Catch the exception & return a failure result
            Debug.WriteLine(Err.Description)
            Dts.TaskResult = ScriptResults.Failure
        End Try

    End Sub

    Public Sub UploadDocument(ByVal localFile As String, _
                ByVal remoteFile As String)
        ' Read the local file into a byte stream array
        ' the file contents will be copied from the source into memory in the 'filecontents' object
        ' further details about the stream object can be found here:
        ' http://msdn.microsoft.com/en-us/magazine/cc163710.aspx
        Dim r As Byte()
        Dim stream As System.IO.FileStream = New System.IO.FileStream(localFile, _
                    System.IO.FileMode.Open, System.IO.FileAccess.Read)
        Dim reader As System.IO.BinaryReader = New System.IO.BinaryReader(stream)
        Dim filecontents As Byte() = reader.ReadBytes(CInt(stream.Length))
        reader.Close()
        stream.Close()

        ' Set the variable for the target client, server name & document library specifically
        Dim sSPURL As String = CStr(Dts.Variables("SPServerName").Value)
        Dim sDocLib As String = CStr(Dts.Variables("SPDocLibrary").Value)
        Dim sDocLibFolder As String = CStr(Dts.Variables("SPDocLibraryFolder").Value)
        Dim sRemoteFileURL As String

        ' Get the current credentials, this allows windows authetication
        ' credentials to run an unattended admin account in a sql agent job without storing ant passwords
        Dim NC As New NetworkCredential
        NC = System.Net.CredentialCache.DefaultCredentials

        ' Set the remote url for the webclient object
        ' and do some string parsing to set a valid url
        sRemoteFileURL = sSPURL & "/" & sDocLib & sDocLibFolder & _"/" & Trim(LTrim(RTrim(remoteFile)))
        sRemoteFileURL = Replace(sRemoteFileURL, " ", "%20")
        sRemoteFileURL = Replace(sRemoteFileURL, "\", "/")

        ' Create a webclient object to 
        ' send the byte stream to a remote url
        ' set the credential in the web client object
        ' then call the upload method to send the byte stream
        Dim m_WC As WebClient = New WebClient
        m_WC.Credentials = NC
        r = m_WC.UploadData(sRemoteFileURL, "PUT", filecontents)

    End Sub

End Class

This code works perfect. The only problem is, since the credentials were retained from cache and not hard coded whenever the server is rebooted(happens over the weekend night) the credentials were flushed and all the ETLs using the script to upload files to share point fails. Can someone suggest a workaround?

Viewing all 24688 articles
Browse latest View live


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