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

connection string in dev and production

$
0
0

I have a several servers that i want to pull data from.

I put the connection string in a OBJECT variable that come from configuration table and use it in the for loop mapping the value to local variable called connectionstring, this variable is the expression for the connection string property.

So far everything is working as expected.

my problem is that on my development i put my local server in the connection string variable so i will be able to connect to the server so i will be able to map source to destination.

When i deploy the solution to production the data in the configuration table is different obviously but i get a connection error that saying that it try to connect to my dev server.

Any idea why?

Thanks.


Can not connect to Integration services

$
0
0

Hi ,

I have got SQL 2014 installed just recently and SSDT added as feature afterwards.

In management studio I am unable to connect to Integration Services I get the error message see below.

I read about this issue and tried to fix it with Component Services: I opened Component Services, chose my computer then DCOM config where I right clicked Microsoft SQL Integration Services 12.00 and in the security tab I added all privileges to all users.In services I restarted both SQL server and Integration Services.

Still, unless I open SQL Management Studio as administrator I got the following error when I try to connect Integration Services:

TITLE: Connect to Server
------------------------------

Cannot connect to "".

------------------------------
ADDITIONAL INFORMATION:

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

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

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

Connecting to the Integration Services service on the computer "" failed with the following error: "Access is denied."

By default, only administrators have access to the Integration Services service. On Windows Vista and later, the process must be running with administrative privileges in order to connect to the Integration Services service. See the help topic for information on how to configure access to the service.


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

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

Connecting to the Integration Services service on the computer "" failed with the following error: "Access is denied."

By default, only administrators have access to the Integration Services service. On Windows Vista and later, the process must be running with administrative privileges in order to connect to the Integration Services service. See the help topic for information on how to configure access to the service.


------------------------------
BUTTONS:

OK
------------------------------

Does someone know what to change and where to get access?

Thanks

How to get child package name in case of an Error while executing its Parent package through "PackageInfo" class (using C# code) in a script task of another SSIS package

$
0
0

Hi,

Context:

The Architecture of my project is:

I am calling a Master package (which further calling child packages and those child packages further calling their child packages and so on) through C# code which is written in a script task of another SSIS package. Because my Master package is deployed using the Project deployment model in SQL Server 2012, I am calling this Master package through the "Microsoft.SqlServer.Management.IntegrationServices.PackageInfo" class by setting all the prerequisite values like "Catalog" and "CatalogFolder" etc.

I able to execute my Master package (and its child packages) successfully.

Problem Statement:

How to get the name of Child package and its execution ID in case child package encounters any error while execution?

By using "Microsoft.SqlServer.Management.IntegrationServices.ExecutionOperation.PackageName" property I always get the name of my Master package and not its child package name. I able to get other exception/error details using the "OperationMessage" class but not the child package name and its execution ID.

Please see the attached code and let me know if there is any way through which I can get the name of the child package in which the error has occurred and its execution ID.

public bool ExecutePackage()
        {
            bool returnFlag = false;
            string pkgExecutionStatus = string.Empty;


            try
            {
                string projectName;
                string serverName;
                string packageName;
                string connectionString;
                string folderName;
                bool use32BitRunTime;
                string connectionStringOLEDBTarget;
                string dbName;


                serverName = Convert.ToString(Dts.Variables["ServerName"].Value);
                folderName = Convert.ToString(Dts.Variables["ForlderNameInIntServicesCatalog"].Value);
                projectName = Convert.ToString(Dts.Variables["ProjectNameInIntServicesCatalog"].Value);
                packageName = Convert.ToString(Dts.Variables["PackageNameToExecute"].Value);
                dbName = Convert.ToString(Dts.Variables["DatabaseName"].Value);

                connectionString = string.Format("Data Source={0};Initial Catalog=msdb;Integrated Security=SSPI;", serverName);
                connectionStringOLEDBTarget = string.Format("Data Source={0};Initial Catalog={1};Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;", serverName, dbName);

                //Create instance of Integration Services using the connection string
                IntegrationServices integrationServices = new IntegrationServices(new System.Data.SqlClient.SqlConnection(connectionString));

                //Get the SSIDB catalog
                Catalog catalog = integrationServices.Catalogs["SSISDB"];

                //Get the folders inside the catalog
                CatalogFolder catalogFolder = catalog.Folders[folderName];

                //Get the SSIS package from the catalog --> Folder --> Project --> Package Name
                PackageInfo package = catalogFolder.Projects[projectName].Packages[packageName];

                //Set Project Parameter (proParamFeedID) using Collection for ExecutionValueParameterSet
                Collection<PackageInfo.ExecutionValueParameterSet> setValueParameters = new Collection<PackageInfo.ExecutionValueParameterSet>();
                setValueParameters.Add(new PackageInfo.ExecutionValueParameterSet
                {
                    ObjectType = 20,
                    ParameterName = "proParamFeedID",
                    ParameterValue = feedID
                });
                setValueParameters.Add(new PackageInfo.ExecutionValueParameterSet
                {
                    ObjectType = 20,
                    ParameterName = "proParamConnStrOLEDB",
                    ParameterValue = connectionStringOLEDBTarget
                });

                //Set this variable to make the execution of Main.dtsx package synchronous. Otherwise it will get executed asynchronously
                setValueParameters.Add(new PackageInfo.ExecutionValueParameterSet
                {
                    ObjectType = 50,
                    ParameterName = "SYNCHRONIZED",
                    ParameterValue = 1
                });

                //Set package parameters here (e.g. paramFeedID)
                package.Parameters["paramFeedID"].Set(ParameterInfo.ParameterValueType.Literal, feedID);
                package.Alter();

                //Use 32BitRuntime if running on 32 bit machine
                use32BitRunTime = true;
                //long executionIdentifier = package.Execute(use32BitRunTime, null, setValueParameters);
                long executionIdentifier = package.Execute(false, null, setValueParameters);
                //long executionIdentifier = package.Execute(false, null);

                //Outcome data can be extracted from the Execution object.
                ExecutionOperation execution = catalog.Executions[executionIdentifier];

                //Get the SSIS package execution status for logging
                pkgExecutionStatus = execution.Status.ToString();

                //Check for SSIS package execution status
                switch (execution.Status)
                {
                    case Operation.ServerOperationStatus.Canceled:
                        returnFlag = false;
                        break;

                    case Operation.ServerOperationStatus.Failed:
                        returnFlag = false;
                        //Get the child package execution errors.
                        GetChildPkgExecutionErrors(execution);
                        break;

                    case Operation.ServerOperationStatus.UnexpectTerminated:
                        returnFlag = false;
                        break;

                    case Operation.ServerOperationStatus.Stopping:
                        returnFlag = false;
                        break;

                    case Operation.ServerOperationStatus.Success:
                        returnFlag = true;
                        break;

                    default:
                        returnFlag = true;
                        break;
                }

            }
            catch(Exception ex)
            {
                if (!string.IsNullOrWhiteSpace(errorDetails))
                    errorDetails = errorDetails + "<br> Some Error has occurred in the 'ExecutePackage()' method of the script task. Below are the details: <br>" + ex.ToString();
                else
                    errorDetails = "Some Error has occurred in the 'ExecutePackage()' method of the script task. Below are the details: <br>" + ex.ToString();

                returnFlag = false;
            }

            return returnFlag;
        }

        /// <summary>
        /// This method fetches any errors (if occurred) while executing the child package
        /// </summary>
        /// <param name="exectionOperation"></param>
        public void GetChildPkgExecutionErrors(ExecutionOperation exectionOperation)
        {

            StringBuilder errorMsg = new StringBuilder();

            errorMsg.AppendLine("Error Details of the Child package: <br>");
            errorMsg.AppendLine("Child package Execution Status: " + exectionOperation.Status.ToString() + "<br>");

            foreach (OperationMessage message in exectionOperation.Messages)
            {
                string messageSourceType = string.Empty;

                switch (message.MessageSourceType)
                {
                    case 10:
                        messageSourceType = "Entry APIs, such as T-SQL and CLR Stored procedures";
                        break;
                    case 20:
                        messageSourceType = "External process used to run package (ISServerExec.exe)";
                        break;
                    case 30:
                        messageSourceType = "Package-level objects";
                        break;
                    case 40:
                        messageSourceType = "Control Flow tasks";
                        break;
                    case 50:
                        messageSourceType = "Control Flow containers";
                        break;
                    case 60:
                        messageSourceType = "Data Flow task";
                        break;
                }


                string messageType = "";
                switch (message.MessageType)
                {
                    case 120:
                        messageType = "Error";
                        errorMsg.AppendLine("Package Name: " + exectionOperation.PackageName + "<br>");
                        errorMsg.AppendLine("Message source type: " + messageSourceType + "<br>");
                        errorMsg.AppendLine("Message Type: " + messageType + "<br>");
                        errorMsg.AppendLine("Details: " + message.Message + "<br>");
                        errorMsg.AppendLine("<br>");
                        break;

                    case 110:
                        messageType = "Warning";
                        errorMsg.AppendLine("Package Name: " + exectionOperation.PackageName + "<br>");
                        errorMsg.AppendLine("Message source type: " + messageSourceType + "<br>");
                        errorMsg.AppendLine("Message Type: " + messageType + "<br>");
                        errorMsg.AppendLine("Details: " + message.Message + "<br>");
                        errorMsg.AppendLine("<br>");
                        break;

                }
            }

            if (!string.IsNullOrWhiteSpace(errorDetails))
                errorDetails = errorDetails + "<br>" + errorMsg.ToString();
            else
                errorDetails = errorMsg.ToString();

        }
        

Thanks.

Prateek

How to find the parent package

$
0
0

Hi,

The problem I'm trying to solve is, given an instance of a SSIS package being executed, I need to find the GUID and execution id of the package that calls it. According to the API (https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.package.aspx) the Package class

has a property "Parent", which returns the instance of the container that contains the child package. In reality though, this doesn't seem to work. Here's what I did,

1. Create a child package that simply has a script task which writes a line to a file for debugging purpose.

2. Create a custom SSIS component in which the child package is called by the myPackage.Execute() method;

3. Given the reference myPackage, try to print the parent container id through the FireInfo() method from IDTSComponents interface.

What I got was an "reference not set to an object" error, which means the parent property is null. This leads me to wonder, when is the parent property set? Is it only set during the execution of the child package? I tried to access it both before and after executing the child package, and in both cases the value was null.

My ultimate goal is to write the parent package id (and execution id) into the ssis log so as to easily trace the execution of packages. Another option to achieving this goal would be through passing values via parent package variables but that seems to be too clumsy. 

Any help / suggestion is greatly appreciated.

Regards,

Amos

SSIS fuzzy lookup and dates

$
0
0
Hello, 

I'm using SSIS fuzzy lookup transformation to match clients together across several databases where the following predicates are 95% similar to each other:

SURNAME (text)
FORENAME (text)
GENDER (text)
DATE OF BIRTH (date) (format 'dd/MM/yyyy')

Because SSIS can only use text strings for fuzzy lookup transformations, what is the best way of using fuzzy lookup transformation on DATE OF BIRTH? 

1) Convert 01/01/2015 to '01/02/2015' ?

2) Split date parts into three columns - e.g.  '01' , '02', '2015'?

3) Convert short date type into long date types in three columns e.g. 'ONE', FEBRUARY', '2015' ?

4) Other?

In brief testing, it looks SSIS doesn't handle option 1) particularly well - i.e. '01/02/2015' is not deemed similar to '02/02/2015'.

Thanks!

OC


Incremental Appending Value

$
0
0

Hi,

Is there a way in SSIS to go through a certain column in a table and to collect incrementally the values for each row in this column and to finally insert the final value to a second field or parameter? 

Is it possible to do it with no external code? only within SSIS tasks?

thanks


Audit logging in SSIS

$
0
0

Hi,
I ma having a package having 10 DFT Task.
In Each DFT Task there are odd number of insert and update at the end
for example.
source>lookup>lookup1>lookup2>transformation>conditionalsplit>

1 New CurrYearMinus4 YEAR(ScheduleDepartDate) == (@[User::CurrentYear] - 4) && ISNULL(Run_Id)
2 New CurrYearMinus3 YEAR(ScheduleDepartDate) == (@[User::CurrentYear] - 3) && ISNULL(Run_Id)
3 New CurrYearMinus2 YEAR(ScheduleDepartDate) == (@[User::CurrentYear] - 2) && ISNULL(Run_Id)
4 New CurrYearMinus1 YEAR(ScheduleDepartDate) == (@[User::CurrentYear] - 1) && ISNULL(Run_Id)
5 New CurrYear YEAR(ScheduleDepartDate) == @[User::CurrentYear] && ISNULL(Run_Id)
6 Update CurrYearMinus4 YEAR(ScheduleDepartDate) == (@[User::CurrentYear] - 4) && Run_Id > 0
7 Update CurrYearMinus3 YEAR(ScheduleDepartDate) == (@[User::CurrentYear] - 3) && Run_Id > 0
8 Update CurrYearMinus2 YEAR(ScheduleDepartDate) == (@[User::CurrentYear] - 2) && Run_Id > 0
9 Update CurrYearMinus1 YEAR(ScheduleDepartDate) == (@[User::CurrentYear] - 1) && Run_Id > 0
10 Update CurrYear YEAR(ScheduleDepartDate) == @[User::CurrentYear] && Run_Id > 0

as you can see that data gets splitted and inserted and updated into different tables.
in above example data gets inserted into 5 tables and update don same.

Now I want to log how many records gets inserted and updated on each tables.

.      We would like to have logging for each table loading.

TableName

StartTime

EndTime

Inserted

Updated

Status


like this I have 10 DFT on my control flow.

requesting you to suggest the best way to do the same.


Thankx &amp; regards, Vipin jha MCP

Executing SSIS packages in order

$
0
0
Project => New SSIS package => Execute package task and in this many more Execute package task with connectors. When we execute the master package how it will decide which is the first package.

Error "To run a SSIS package outside of SQL Server data tools you must install of Integration service or highter.

$
0
0

Hello Team,

I am trying to execute a SSIS package from web page. When i try to do that i am getting following error.

"To run a SSIS package outside of SQL Server data tools you must install <task name used in package> of Integration service or highter."

In my machine Integration Services are installed and its service is also in running state.

Please help me on this.

Thanks,

Ramesh


Thanks, Ramesh Arige

Email Task - Sending emails to different users

$
0
0

Hi,

I am stuck with a problem in SSIS and need your suggestions / help to find the perfect solution.

Problem:

1) I have a table and 2 columns are needed for this task.

 - Validation Status

- Email id

2) I want to check Validation status column and if the value is 'Failed' I must send a email to the corresponding user using the email id column.

Can you please guide me how to solve this task.

The main challenge is face is how to send only one email to the user even though for the particular user many rows are returned with validation failed.

How to send individual emails to different users for the same table. For example if for two users, Validation Status is 'Failed', I would like to have2 separate emails for the users and not to have both the users in the 'To' field together.

Thanks a ton in advance!

SQL Server (2014) Job System sending out failure emails, but there are no failures in the execution report

$
0
0

I have a job that runs every 3 minutes. The email that I received said the job failed at 10:30 a.m. but when I run the "All executions report" I see a skip in the times from 10:27 to 10:33. That failed Job is not logged as an execution.

Any thoughts? I looked in the system event log and I do not see anything odd at that time.


Execute many packages from one Master Package

$
0
0

Hello everyone,

I have 12 packages to execute in order. I made a table in my DB where i mentionned the name of each package and his order in execution.

I want to create a master package that get the name and order from my DB table to execute all packages.

Thanks


Execute SQL Task does not Update from a Date Variable Reliably

$
0
0

I'm using a DateTime variable in SSIS 2008 that is used to set the SQLStatement property of an Execute SQL Task.

"DELETE FROM Labor WHERE Week =  '" +  (DT_WSTR, 100)  @[User::Week] + "'"

Week is the next Sunday:

DATEADD( "day", @[User::DaysTillSunday] , @[User::TheDayThatIsTwentyMinutesPrior]  )

DaysTillSunday:

DATEPART( "dw", @[User::TheDayThatIsTwentyMinutesPrior] ) == 1 ? 0 : 8 - DATEPART( "dw", @[User::TheDayThatIsTwentyMinutesPrior] )

TheDayThatIsTwentyMinutesPrior:

(DT_DATE)(DT_DBDATE)DATEADD("minute",-20,GETDATE())

The SSIS Package deletes the current week's data, reloads it with fresh data, then calculates the difference between the current week and last week.

The problem is that randomly, instead of deleting the current week, it will delete the previous week.  This happens maybe 5-10% of the time.  At least it does until I rebuild the package and import it into SQL Server again.

I'm guessing that the Execute SQL Task is not updating the value of the Week variable before it executes.  I started with the source type being a variable.  Then I decided to try Direct input and pass in the Week as a parameter (OLE DB Connection Type).  That didn't work either.

Most recently I tried writing the Week variable to a table first, then having a sequence container with all the tasks second.  Slightly better but I still saw the date was wrong 2 times in about 90 executions.  I was hoping that writing the Week variable out to the database would force an update of any associated connections to it, but that didn't seem to work.

Any ideas?  Is this a known issue, am I missing a setting?

thanks,

John

Agent job issue

$
0
0

SSIS package runs fine from visual studio bids but when I tried running it from sql server agent it hangs without failing. There are no errors but it hangs there doing nothing.

What might be the problem?

Thanks,


sree

VS 2008 Protection Levels & Deployment

$
0
0

Hi All,

I have developed a SSIS solution with multiples pacakges in VS 2008 using the protection level of Encrypt Sensitive with password, because VS 2008 wasn't saving the OLEDB passwords. So now it prompts me to enter the password each time I open a package within the solution, which is fine as I created and developed it. but my questions are

1) is there a way save the passwords within the solution so it doesn't prompt me all the time?

2) I tried changing the package protection level to server storage and it says can't save when using that protection level when saving to XML file format?

3) When I deploy to the SQL server how can I run the solution without entering the password?

Thanks


How to count # of occurrences of a character inside a string?

$
0
0

I have a string of characters in my data flow and I need to add a derived column showing the # of times a certain character appears within that string.  For example, my string in the data flow is:

 

NNNNNRJKSURNNNEJNNNN

 

Now I need to count the number of "N"s in that column.  From the example above, I should get the integer 12, and that would be the value of my derived column.  Any ideas?

Whats the difference between executing a package from SQL and Visual Studio?

$
0
0

Hi,

We have a package that is currently failing to run when deployed to SQL. This has been tried from a schedule and also executed manually both are failing.
I have tried from Visual studio running on various machines (windows 8, server 2012) and in all cases run perfectly.

I am trying to understand the differences between deploying to SQL and running from VS so maybe I can figure out why this is happening.

I have the following errors when I run from SQL.
DTS_E_PROCESSINPUTFAILED - all errors like this point to the 'Sort' tasks in the script
dts_e_processinputerror not enough storage is available

I have tested in four environments and all fail from SQL but not from VS!

Last night I tried from my laptop and executed the package from SQL - it didn't fail but was still running in the morning so I terminated. Note this takes around 20 mins running from VS! why would it be so quick from VS but fail or take so long on SQL?

The test running at the moment is on a server with dynamic memory currently at 14GB. I decreased SQLs RAM to 4GB and it hasn't failed yet but has been running for two hours. Before changing this the package failed after a short time.

I thought it may have something to do with running from a virtual machine but doesn't explain why it couldn't run locally on my laptop.

All ideas welcome :) Many thanks,

Davina

Execute SQL Task with TransactionOption Required fails.

$
0
0

Hi all,

I'm using SSDT (2013) and connect to a SQL2014 DB. While migrating from SQL2008R2 to SQL2014 I've run into a problem concerning the TransactionOption property. To simplify the case, I've created a test package.

I created an Execute SQL Task with a simple select statement to a remote server. This is the only task in the control flow.
The connection has been set up with the RetainSameConnection property to True.

So far the package/task works.

But when I change the TransactionOption property of the Execute SQL Task to Required, the package/task fails.
This is the error that I receive : [Execute SQL Task] Error: Failed to acquire connection "xxxxxx". Connection may not be configured correctly or you may not have the right permissions on this connection.

The MSDTC service is running on both my client and the server. It is configured on both machines as seen below in the screenshot. (Can't post screenshot due to verification, so typed the selected properties)
Firewall is off on both machines for this test. (In- & Outbound rules are configured as well).

Does anyone have an idea what is going wrong ? Or is there anything else I need to configure except for the MSDTC service? Any help would be greatly appreciated.

Local DTC Properties:
Network DTC Access -> enabled
Client and Administration : Allow Remote Clients -> enabled
Transaction Manager Communication : Allow Inbound & Outbound -> enabled
Transaction Manager Communication : Mutual Authentication Required -> enabled
Enable SNA LU 6.2 Transactions -> enabled
DTC Logon Account -> NT AUTHORITY\Network Service

Best regards,
Michiel


C# code to create file from variable value

$
0
0

Hi

My Execute SQL Task will store the file name into a variable(mFile) of type string datatype.

Now I wanted a script task (C# code) to create a filename from the variable (mFile) value.

Can someone help me with this?

Since it is a common issue I tried a lot in the internet but none of the queries worked.

Thank you.

Version Identification as need to install vversion of SSIS asnd SSIR to be installed

$
0
0

Hi,

I am learning ETL and advanced SQL Server tactics. there I want to work around hands on on SSIS and SSIR. I want to identify the version of SSIS asnd SSIR to be installed  with my edition of SQL Server Management Studio.

Please guide me through to identify the compatible trial version of the same.

Links for the free trial download are also Welcome.

Many Thanks

Chieeff

Viewing all 24688 articles
Browse latest View live


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