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

Wrong code page when executing package on server, but correct in Visual Studio

$
0
0

Hi

I have an ssis packge that loads hard coded strings into a table in a data flow task. The columns of the table are all nvarchar, and the text that is loaded contains the Swedish special letters: "Å Ä Ö". When I check the meta data inside the data flow task, the columns have the data type "DT_WSTR"

When the package is executed from inside Visual studio, all is fine and the text in the table is exactly as it should be.

However

WHen I deploy the very same package to the same server as Visual Studio executed against, and execute it on the server by right clicking on the package, the text that is loaded to the same table is not correct.

Instead of this:

"Ack första halvåret t.o.m. april"

I get this

"Ack första halvåret t.o.m. april"

How can this be?

It seems to me like there is a property on the server that somehow change the codepage?

I dont know if it matters but the default collation of the server is SQL_Latin1_General_CP1_CI_AS, and that is also the collation of the database.


Enable the Outlook Security properties while sending a Mail using Send Mail Task

$
0
0

Hi Guys,

Is it Possible to send an Email by enabling the Outlook Security feature of Restricted|Do Not Forward, If we are using the Send Email Task?

Is there Any property that we need to configure the Security Feature.

Thank YOU

Derived column expression help

$
0
0
Hi all,

I want to extract specific portion from file Name

Please help me with Derived Component Expression

For Example :

My file Names are :

201701_Purchase_Maruti_Actual_China_Sales Flash.xlsx
201702_Purchase_Maruti_Actual_India_Sales Flash.xlsx
201702_Sales_Maruti_Actual_GI_ABC Flash.xlsx   

Ans : 

China
India
ABC

Loading Excel data to SQL server error on Date columns

$
0
0

Hello Folks -

I have Excel file importing to Sql server table. But the SSIS package fails with the following error

I have Closed Date column in Excel Data coming as 12/20/2019 but looks like the sql server table format closed date format is date time.

HOw can i add a solution so that i add the time part to the exisiting excel data and load or any simple solution anyone know?

Error 0xc02020c5: Data Flow Task 1: Data conversion failed while converting column "ClosedDate" (36) to column "ClosedDate" (281).  The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".

Calling Oracle procedure from Execute sql task

$
0
0

Hio Garus,

I have been trying to call oracle procedure from EXECUTE SQL Task but no luck,

Oracle procedure accept input parameters and its return couple of out  variables.

Procedure format is here.

   college.information

     (id                     IN  VARCHAR2,

     date                   IN  DATE     DEFAULT SYSDATE,

     class                      IN  VARCHAR2 DEFAULT NULL,

      report       OUT  VARCHAR2,

     status                                  OUT  NUMBER,

      message                             OUT  VARCHAR2

     )

Could you please help me here by providing solution for accepting input parameters and return values.

Read First Line of Text File SSIS VB Script

$
0
0
I am trying to find a way to open a text file read the first line into a string and then close the text file using SSIS VBScript. I have found several examples but none of them work.

SSIS - Convert UTC datetime to a specific zone, considering Day Light Savings

$
0
0

Hi, 

Is there a SQL/SSIS function to convert the UTC datetime to EST or specific time zone   ?  

Also, how to consider the day light savings - time changes  ?

the OLE DB adapter cannot convert between types "DT_DBTimeStamp" and "DT_I4"

$
0
0
Can anyone help me to remove this error? Highly appreciate the help.


Thanks

Issue in Sending mail using Script task

$
0
0

Hi Team,

I am trying to send mail using script task.

below is my C# code

#region Help:  Introduction to the script task
/* The Script Task allows you to perform virtually any operation that can be accomplished in
 * a .Net application within the context of an Integration Services control flow. 
 * 
 * Expand the other regions which have "Help" prefixes for examples of specific ways to use
 * Integration Services features within this script task. */
#endregion


#region Namespaces
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using System.Net.Mail;
using System.Net;
#endregion

namespace ST_873a6255c71d433ab967fdc152db475d
{
    /// <summary>
    /// ScriptMain is the entry point class of the script.  Do not change the name, attributes,
    /// or parent of this class.
    /// </summary>
[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
        #region Help:  Using Integration Services variables and parameters in a script
        /* To use a variable in this script, first ensure that the variable has been added to 
         * either the list contained in the ReadOnlyVariables property or the list contained in 
         * the ReadWriteVariables property of this script task, according to whether or not your
         * code needs to write to the variable.  To add the variable, save this script, close this instance of
         * Visual Studio, and update the ReadOnlyVariables and 
         * ReadWriteVariables properties in the Script Transformation Editor window.
         * To use a parameter in this script, follow the same steps. Parameters are always read-only.
         * 
         * Example of reading from a variable:
         *  DateTime startTime = (DateTime) Dts.Variables["System::StartTime"].Value;
         * 
         * Example of writing to a variable:
         *  Dts.Variables["User::myStringVariable"].Value = "new value";
         * 
         * Example of reading from a package parameter:
         *  int batchId = (int) Dts.Variables["$Package::batchId"].Value;
         *  
         * Example of reading from a project parameter:
         *  int batchId = (int) Dts.Variables["$Project::batchId"].Value;
         * 
         * Example of reading from a sensitive project parameter:
         *  int batchId = (int) Dts.Variables["$Project::batchId"].GetSensitiveValue();
         * */

        #endregion

        #region Help:  Firing Integration Services events from a script
        /* This script task can fire events for logging purposes.
         * 
         * Example of firing an error event:
         *  Dts.Events.FireError(18, "Process Values", "Bad value", "", 0);
         * 
         * Example of firing an information event:
         *  Dts.Events.FireInformation(3, "Process Values", "Processing has started", "", 0, ref fireAgain)
         * 
         * Example of firing a warning event:
         *  Dts.Events.FireWarning(14, "Process Values", "No values received for input", "", 0);
         * */
        #endregion

        #region Help:  Using Integration Services connection managers in a script
        /* Some types of connection managers can be used in this script task.  See the topic 
         * "Working with Connection Managers Programatically" for details.
         * 
         * Example of using an ADO.Net connection manager:
         *  object rawConnection = Dts.Connections["Sales DB"].AcquireConnection(Dts.Transaction);
         *  SqlConnection myADONETConnection = (SqlConnection)rawConnection;
         *  //Use the connection in some code here, then release the connection
         *  Dts.Connections["Sales DB"].ReleaseConnection(rawConnection);
         *
         * Example of using a File connection manager
         *  object rawConnection = Dts.Connections["Prices.zip"].AcquireConnection(Dts.Transaction);
         *  string filePath = (string)rawConnection;
         *  //Use the connection in some code here, then release the connection
         *  Dts.Connections["Prices.zip"].ReleaseConnection(rawConnection);
         * */
        #endregion


/// <summary>
        /// This method is called when this script task executes in the control flow.
        /// Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
        /// To open Help, press F1.
        /// </summary>
public void Main()
{
            MailMessage msg = new MailMessage("gaya3cute18@gmail.com", "gaya3cute18@gmail.com", "Subject", "Hai");
            SmtpClient client = new SmtpClient("smpt.gmail.com", 587);
            client.EnableSsl = true;
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            client.Credentials = new NetworkCredential("abc@gmail.com", "*********");

            client.Send(msg);

            Dts.TaskResult = (int)ScriptResults.Success;
}

        #region ScriptResults declaration
        /// <summary>
        /// This enum provides a convenient shorthand within the scope of this class for setting the
        /// result of the script.
        /// 
        /// This code was generated automatically.
        /// </summary>
        enum ScriptResults
        {
            Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
            Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
        };
        #endregion

}
}

I am Getting the below error while building the package.

Exception has been thrown by the target of an invocation.

   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

Could anyone please let me know if i am missing anything

Thanks-

Gayathri S

Dataflow task not failing for conversion issue

$
0
0
I am trying to upload excel file into a sql table. The datatype column is int however if the excel input file has a single row as varchar it is converting to null value in the sql table. What need to be configured to fail the dataflow task

SSIS package with dynamic database connection

$
0
0

Hi,

I am trying to fetch 10 table data from 10 tenant database dynamically. I have Used ForeEach Loop Container to iterate each database one by one and dump to destination table.

Please find below screeshot for package


I have created a variable "Database Name", "Server Name", "UserName", "Password" and set the value.  In execute script I have fetch all the tenant database name. In "Database Name" variable i have set default db. Here my package run successfully 1st time but 2nd time in foreach loop container it fails and give error

"[OLE DB Source [93]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Dabasename" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed."

I read many thread saying Set DelayValidation to True in Data Flow Package level. I did that too. Also created a new connection by deleting old one. Still getting this error. Is there any other way to short out this issue?

ESPN#$~https://pro-probowl.com/

$
0
0
https://pro-probowl.com/
https://pro-probowl.com/live/
https://pro-probowl.com/2020/

DFD result in another DFD

$
0
0

Hi,

I want to use Dataflow task1 result into another Dataflow task2 without storing Dataflow task1 result into any destination  table/file. Is it possible?

So here what I am doing in Dataflow task 1 is Taking 2 OLEDB Source and perform join and combine that resultset in 1 using UNION all Now here i don't want to store the result in any table but wants to use the result in another Dataflow (i.e; Dataflow task2)

Thanks in advance

Holding values in object

$
0
0

Hi Gurus,

I have employee table with 8000 employee id's . I want to processes data by employee-id.

  i am taking 8000 ID's Into object variable using Execute sql task. and process each ID's inforeach loop.

Please let me know is it correct way or other best options.

Thanks for ur help.

HOW TO GET START DATE ND END DATE

$
0
0

Hello Everyone.

I have developed a package. So in my event handling, I am trying to record the error details of my package if I get any error or if it fails. I was successful in doing that. I NEED TO RECORD MY PACKAGE START TIME AND END TIME 

NOTE: I don't want to do it through ssisdb or log. is there any other way that I can record start time and end time in package it self or in event handler.


connection manager value passed through via sql server agent dilemma

$
0
0

hi all:

    We have a sql server job which calls a ssis pkg. Connection string was passed via Data Sources table in the job step. 

Business asks us to use sql server login instead of windows authentication.  The challenge is that our IT Sec team does not

allow plain username and password to be put into the connection string. 

 Is there any other way to solve this issue? 

thanks

 Hui


--Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

RunGuid Value upto 23 digits in derived Column

$
0
0
Hi everyone I want to insert GuidId in my target table . It has the value upto 23 digits without any special chars in it. Ex: 20200106115423786445113. I got an expressionLEFT(REPLACE(REPLACE(REPLACE((DT_STR,30,1252)GETDATE(),"-",""),":",""),"",""),14) this expression gives me the value up to 14 digits but I want upto 23 digits. I am struck here couldn't find any solution. please help me. TIA

Script task is not writing the variable value

$
0
0

Hi All,

I am using script task to pick up the latest file from the directory. I have two variables one for directory and one for file name and below is the code I am using to update the filename variable to the latest updated file name.

After I run the code the variable filename is not being updated not sure why?

Script task Code:                                                 

public void Main()
{
            // TODO: Add your code here
            var directory = new DirectoryInfo(Dts.Variables["User::Directory"].Value.ToString());

            FileInfo[] files = directory.GetFiles();
            DateTime lastModified = DateTime.MinValue;

            foreach (FileInfo file in files)
            {
                if (file.LastWriteTime > lastModified)
                {
                    lastModified = file.LastWriteTime;
                    Dts.Variables["User::FileName"].Value = file.ToString();

                }
            }
            //MessageBox.Show(Dts.Variables["User::FileName"].Value.ToString());


            Dts.TaskResult = (int)ScriptResults.Success;


        }


        enum ScriptResults
        {
            Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
            Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
        };

Script Task:


SSIS 2012 Unknown Destination component

$
0
0

Hello,

I have a package containing several Data Flow Tasks wich all used to contain Ado. Net Destination; how ever I don't know when or how all my destinations task turned into a type that I had never seen before in SSIS.

 this task: Does not open up like an olde db or Ado Destination when double clicked, neither has a 'show advanced options' item in the context menu. and if I try to delete it, it gives me an error like this:

"SSIS Designer does not allow this component to be deleted.
The task editor did not clean up properly after the task was removed:"

this is actually the mentioned task:

well I can not include the image but it looks like a square with an arrow pointing leftwards in the left of it and another one also pointing to the left in the right.

thanks,

Error Azure SQL Server Integration Service (SSIS IR) deployment from Solution

$
0
0

I am getting the error while deploying SQL Server Integration service project to Azure Integration Service database catalog. I got this error while click "connect" after providing the destination server, and Authentication details.

Visual Studio Data tools Version: 15.9.7

The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

I was able to connect the Azure SQL DB Integration service catalog from Sql Server Management studio.

Any help appreciated!

 

Viewing all 24688 articles
Browse latest View live


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