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

Object can be disposed more than once in method - SSIS Script task

$
0
0

Hi Team,

When am using bellow script in SSIS script task am getting bellow. Please help how can i use script task to execute bellow provided C# code.

Error:

WarningCA2202Object 'msi' can be disposed more than once in method 'Program.Unzip(byte[])'. 
To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.

My C# code:

#region Namespaces
using System;
using System.Data.SqlClient;
using System.IO;
using System.IO.Compression;
using System.Text;
#endregion

namespace UnZipData
{

    class Program
    {
        static void Main(string[] args)
        {
            SqlConnection con;

            SqlDataReader reader;

            try

            {
                string connection = System.Configuration.ConfigurationManager.ConnectionStrings["Profiler"].ConnectionString;


                con = new SqlConnection(connection);
                con.Open();

                reader = new SqlCommand("SELECT TOP 100 Id,Name,requestXML,responseXML FROM TableName order by 1 desc", con).ExecuteReader();

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        // WriteAllText creates a file, writes the specified string to the file,
                        // and then closes the file.    You do NOT need to call Flush() or Close().

                        string filePath = $@"D:\FareRules\" +  reader.GetInt32(0);
                        File.WriteAllText(filePath, Unzip((byte[])reader["requestXML"]));
                    }
                }
                else
                {
                    Console.WriteLine("No rows found.");
                }
                reader.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }

        public static void CopyTo(Stream src, Stream dest)
        {
            byte[] bytes = new byte[4096];


            int cnt;


            while ((cnt = src.Read(bytes, 0, bytes.Length)) != 0)
            {
                dest.Write(bytes, 0, cnt);
            }
        }

        public static string Unzip(byte[] bytes)
        {
            using (var msi = new MemoryStream(bytes))
            using (var mso = new MemoryStream())
            {
                using (var gs = new GZipStream(msi, CompressionMode.Decompress))
                {
                    //gs.CopyTo(mso);
                    CopyTo(gs, mso);
                }


                return Encoding.UTF8.GetString(mso.ToArray());
            }
        }
    }
}


Thanks Bala Narasimha


SSIS dev and test on same server

$
0
0

HI 

I am new to infrastructure. my director says he wants to have  dev and test as two different databases  in  the same server(he want to use virtual machines) and he also wants to have  dev and test as two different databases  in same server .  we have to eventually create a Sql agent job to deploy ssis packages and  schedule them to run overnight.  and this will also be our database server with tables and data , we wont have dedicated ETL servers for SSIS.


can you please  let me know is this possible? 

I am thinking its not possible, because ssisdb  will hold the same packages for dev  and test. so you are running same packages for dev  and test but   you are pointing to two different databases (dev database and   test database) which are  in same server. 

is it a best practice to keep dev and test in same server(virtual machine)  ? 

The data will be eventually reached to 600GB in next one year.


Unable to uninstall SQL Server Integration Services Projects Extension

$
0
0

I installed SQL server, then SSDT from VS installer and after that the SSIS Extension v3.0 for VS Community 2019. But now that when I try to uninstall it I get the following error:

Some components will not be uninstalled because removing them would place this computer in an unsupported state. Please manually remove them in Control Panel.

After that I get the following message:

The configuration registry database is corrupt (0x800703F1)

Running an SSIS package through Batch File

$
0
0
Is there a way to read the DTEXEC result and when DTExec: The package execution returned DTSER_SUCCESS (0). contine the remaining steps in the batch file otherwise STOP .

Oracle data source connectivity issue in ETL Package using script task(C# Code)

$
0
0

Hi,

I'm trying to connect Oracle data source in ETL package using script task(C# Code) and getting server version error.

Help me how to resolve this issue.

Visual studio version : 2015

Connection Type : OLEDB Connection

Provider : OraOLEDB.Oracle

Thanks,

Krishnan

ODBC Progress datatype problems after updating to VS 2017 15.9

$
0
0

Hey there,

we are currently using VS 2017 15.7.5 and SSDT 15.8

We've got SSIS packages which read data from a Progress database via ODBC.

We updated to VS 2017 15.9.2 and now all the ODBC Progress packages fail, nothing else has been changed.

The problem we have is that all the columns which were previously correctly identified as DT_DBDATE are now recognized as DT_BYTES.

It seems to be some weird regional or language problem.

Comparing the ODBC Source previews:

On the machine where we still have 15.7.5 date values show as for example "2018-11-05".

On the new machine with 15.9.2 date values show as "3/11/2014 12:00:00 AM".

Changing any of the machine's regional settings didn't help, so it must be a problem within Visual Studio?

Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

$
0
0

Hi  Team,

Please help on bellow issue.

[Execute SQL Task] Error: Executing the query "update EIV set

EIV.InvoiceDate = RD.InvoiceDate,
..." failed with the following error: "No value given for one or more required parameters.". 
Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Query in Execute SQL Task:

update EIV set

EIV.InvoiceDate = RD.InvoiceDate,
EIV.ClientName = RD.ClientName,
EIV.AccountNumber = RD.AccountNumber,
EIV.ClientCurrency = RD.ClientCurrency,
EIV.bookingMode = RD.bookingMode
from
 Table1 EIV join Table2 RD 
onEIV.MFRefernce = RD.MFReference and
EIV.InvoiceID = RD.InvoiceID and
EIV.InvoiceNo = RD.InvoiceNo and
EIV.FlightId = RD.FlightId

where RD.isactive=1 and RD.row_id <=?

Screen shots:

main package


Thanks Bala Narasimha

How to pass a variable to one package to another package in ssis

$
0
0
 I would like to pass a variable from one package to another package in SSIS. Is it possible?

How to make the data vertical rows instead of horizontal

$
0
0

Hi All 

I am getting the data from excel and i have it in the horizontal format like below, but in the DFT when i click on the columns i only see the Date column and not the completed column

Date1/2/20191/3/20191/4/20191/7/20191/8/20191/9/2019
Completed261939266

How can i get it as 

DATE        COMPLETED

1/2/2019    26                             

Thanks


SSIS Job error: The connection type "PowerQuery" is not recognized as a valid connection manager type

$
0
0

Hi all,

Before posting my question I have already gone through some of the replies on this forum and unfortunately I found no answers. Especially there is this link https://www.powerbi-pro.com/en/power-query-in-ssis/ that describes the how-to. My project runs fine from client side but NOT when deployed. Following is my post: 

I have created an SSIS project and used the PowerQuery component to read from an Excel file. When I execute it from Visual Studio (client side) it runs fine, but when I deploy it on the SQL Server and create a job, by executing it I get a Failed error without any additional information.

When I go through the error list I get the following:

"The connection type "PowerQuery" specified for connection manager "Power Query Connection Manager" is not recognized as a valid connection manager type."

We are stuck and unable to run the job just because it contains the PowerQuery component or connection manager. if there is any resolution to my issue it would be greatly appreciated.

Thank you,

Nikos Zacharakis

Stored Procedure Resultset Issue in SSIS

$
0
0

Hello,

We are upgrading our SQL Server database from 2008 to 2016 and in the process of upgrading, we are also upgrading the SSIS packages. However, there are couple of SSIS jobs that use the update query are failing with the below error message.

'Executing the query "usp_Accts_SFDCAccountId"  failed with the following error. Unable to populate result columns for single row data type. The query returned an empty result set. Possible failure reasons. Problems with the query, Result set not set correctly, parameters not set correctly, or connection not established correctly'.

The "Execute SQL Task" in the SSIS package has not changed, the SSIS package was upgraded using Visual Studio 2017. The Resultset is set to "Single Row" in the Execute SQL task. This is working fine in SQL server 2008 job, but failing with the above error message with SQL Server 2016.

Can someone help?

Issues in while developing the Custom RabbitMQ Source for SSIS using c#

$
0
0

Hi All,

I have got the below c# code from github to build custom RabbitMQ source component and looks like the code was written in 2012 and the same code is working fine in VS 2012 (getting the RabbitMQ source component in DataFlow items), but not working for VS 2015 (not getting the RabbitMQ source component in DataFlow items). Can someone please help me on this.

Solution is available in the below path.

github.com/kzhen/SSISRabbitM

Excel workshet name in SSIS

$
0
0

Hi team

I want to know a way to detect when a specific worksheet exist into a Workbook  or capture the error when open a worksheet and this don't exist in SSIS

Please any help, i will apreciate.

best regards

Marcos


Cannot connect to SSIS, dtsruntimewrap exception 0xC00160AC

$
0
0

I just updated SSMS to v18 and now I cannot connect to SSIS. I was able to previously.

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

Cannot connect to ..

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

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

------------------------------

For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&LinkId=20476

fyi: the for help link above is out of date.

------------------------------

Program Location:

  at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)

  at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)

  at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

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

Exception from HRESULT:0xC00160AC (Microsoft.SqlServer.DTSRuntimeWrap)

------------------------------

For help, click: http://go.microsoft.com/fwlink/?LinkId=506689

------------------------------

Program Location:

  at Microsoft.SqlServer.Dts.Runtime.Application.GetServerInfo(String server, String& serverVersion)

  at Microsoft.SqlServer.Dts.SmoEnum.DTSEnum.GetData(EnumResult erParent)

  at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData()

  at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData(Request req, Object ci)

  at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object connectionInfo, Request request)

  at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)

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

Exception from HRESULT:0xC00160AC (Microsoft.SqlServer.DTSRuntimeWrap)

------------------------------

Program Location:

  at Microsoft.SqlServer.Dts.Runtime.Wrapper.ApplicationClass.GetServerInfo(String bstrMachineName, String& serverVersion)

  at Microsoft.SqlServer.Dts.Runtime.Application.GetServerInfo(String server, String& serverVersion)

I don't know why the versions are different in the about box, but there they are.

I found no SSIS related issues in the error logs.

select @@version

/*

Microsoft SQL Server 2017 (RTM-GDR) (KB4293803) - 14.0.2002.14 (X64)   

Jul 21 2018 07:47:45   Copyright (C) 2017 Microsoft Corporation  

Developer Edition (64-bit) on Windows 10 Home 10.0 <X64> (Build 17763: )

*/



SSIS Server installation

$
0
0

HI 

 we are going to have new sql server and ssis installed on my office machine for ETL work. I asked them for the following softwares . 

1. MS Sql Server 2017 Enterprise edition

2. Latest version of Sql Server Management Studio ---SSMS18.1

3. Visual Studio Enterprise 2017 4. Sql Server Data tools for Visual Studio 2017--- Please use version 15.8.0 (please install all three below components below in this)

5. Sql Server integration Services 2017

6. Sql Server Reporting services 2017

7. Sql Server Analysis Services 2017

8. Microsoft connector for oracle by attunity ---V5.0.

we are also going to have a dedicated ETL Server for  running nightly jobs. I am not sure what softwares that needs to be installed  on that server machine for the deploy ssis packages and agent jobs to run . can you please let me know. Company is willing to get all new softwares that are latest. 

Please forgive if this is a basic question. 


Use SSIS Variable in another class outside of ScriptMain.cs

$
0
0
Hi

The problem I am trying to solve is use a SSIS Variable in another class outside of ScriptMain.cs in the SSIS Script Task. I am trying to use a constructor and get the variables read in other methods. Could you please guide me in the right direction. 

using System.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    public void Main()
    {
        var game = Dts.Variables["User::varGame"].Value.ToString();
	var score = Dts.Variables["User::varScore"].Value.ToString();

        result res = new result(game, score);
    }

    public class result
    {
        string gamenumber;
	string scorecard;

        public result(string game, string score)
        {
           gamenumber = game;
           scorecard = score;
        }
    }
}



Thanks in advance.

SQLEnthusiast



How to upgrade SSIS packages (having script tasks) created in VS 2013 to VS 2015 after SQL server upgrade from 2014 to 2016

$
0
0

Hi,

We recently had SQL server upgrade from SQL 2014 to SQL 2016 and now need to upgrade SSIS packages accordingly to support to the existing SQL server version.

I had tried upgrading the package by opening the Solution in Visual studio 2015 and selecting the Deploy target server to SQL 2016 and it was successful. But when I execute the package, the script task is failed with an error saying Exception has been thrown by the target of an invocation. 

I also tried adding a new script task to the package in VS 2015 and copy pasted the same script from the original script task and then executed. But it failed again with the same error message

Could you please guide me how can I upgrade the SSIS package and execute them successfully.

import csv file in to sql table (double quotes and line feed in few columns)

$
0
0

I have a  csv file that needs to be imported in to  sql table. It has double quote as text qualifier , how ever in few rows couple of columns are line feeding to next line and it has additional " over there . Please find the sample data below

"id","start_date","end_date","Descr","type"
"1234","4/1/1990 12:00:00 AM","12/31/9999 12:00:00 AM","NULL","3"
"5678","4/1/1990 12:00:00 AM","12/31/9999 12:00:00 AM",""The Fee is 1.25% of
reduced below 0.60% of Limited."","2"

The first row represents the column name , the second row is fine, but if you observe the 3rd row the descr field is has a new line after certain part of string and it started and ended  with "". 

Can you please guide how to I recreate the file using this pattern and make it one row.

Thanks

ssis package

$
0
0
SUBSTRING([Name ], FINDSTRING([Name ] + "," , "," , 1), LEN([Name] ))

Manny Musciano

Can someone help me find my error in this query please?

Thank you very much for your help

How t o Start/Control a SSIS Package (Project-deployed) with SQL Server Agent

$
0
0

Hi team,

I have some projects-deployed SSIS-packages stored in SSISBD and working fine when started with Management Studio. To automate them, I would like to use a SQL Server Agent job to execute the packages. The package contains a connection manager that adresses a (localdb) on the same system as the SQL Server 2016 (local) instance.

I can configure the job and start it. The job terminates with error. The error code says, that the (localdb)/ProjectsV13 was not found. THis problem does not occur when the package is started from SSMS.

SSIS packe execution protocol


Regards Jörg

Viewing all 24688 articles
Browse latest View live


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