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

How to insert the data if the data in the two tables doesn't match.

$
0
0

Hi,

I have requirement like,I have to insert the data by comparing the two tables based on the date field.If they both are equal then the data shouldn't be inserted if not the data has to be inserted.

Can some one help me on this ASAP.

Regards,

Sudha


sudha


Inserting data to excel

$
0
0

HI !

I have a table which has got QTY as column, When i insert the data to excel , The data type of inserted data should be Numeric in excel.

Actually now it is in String format.


Regards,


Microsoft.ACE.OLEDB.12.0 provider not registered on local machine for SQL server 2008 R2 after installing AccessDatabaseEngine_x64.exe

$
0
0

Hi,

We have installed SQL server 2008 R2 64 bit version in a 64 bit system and using Visual studio 2008 version for SSIS and Office 2010 suite 64 bit.

Earlier when I used VS 2005 is SSIS the connection string for excel was Microsoft.Jet.OLEDB.4.0 and Excel 8.0 combination for Excel 2003 version (.xls files)

Now I have installed AccessDatabaseEngine_x64.exe as it is a 64 bit platform.

When I try to configure Excel data source in SSIS 2008 using connection string Microsoft.ACE.OLEDB.12.0 and Excel 12.0 combination for office 2010 (.xlsx files) after installing the Access database engine driver I am getting the below error stating

"Microsoft.ACE.OLEDB.12.0" provider is not registered on local machine.

I changed the application pool setting for IIS server to 32 bit and also in BIDS I executed the SSIS Solution as Run64bitRuntime =False i.e. in 32 bit mode still the error retains the same.

Could you please help me out on this so as to whether should I use 32 bit version of Access database engine driver with office 2010 suite or it must be ACE 14.0 and Excel 14.0 combination that must be used to serve the purpose?

Regards,

Adesh

Beginner - How to learn SSIS?

$
0
0

Hii ,

I am new to ssis ,how can I get knwldge of tat


How to update "Encrypt with UserKey" after Windows User Profile replacement?

$
0
0

A problem with my User Profile required that the files be backed up, the profile deleted, a new profile created and my files restored. I have several SSIS projects built in Visual Studio 2012 that use "EncryptSensitiveWithUserKey". I assume the"UserKey" is based on the SID or GUID of my User Profile. Now when I open these projects I get the Warning:

Warning	2	Warning loading SSISProject.dtproj: Warning: Failed to decrypt sensitive data in project with a user key. You may not be the user who encrypted this project, or you are not using the same machine that was used to save the project. If the sensitive data is a parameter value, the value may be required to run the package on the Integration Services server. 	SSISProject.dtproj	0	0

Is there a way to reset the UserKey in an existing project to the key for my new Profile? Is the value derived and used for encryption stored in the .dtproj file? If so can I copy that value from a new SSIS project into the .dtproj file for my old projects? There has to be some way to "transfer ownership" of an SSIS project.

 

Export SQL 2008 to Excel 2007, trouble with money

$
0
0

Hello.
I have a problemwhen I exportthroughssis,a table that containsamoneyor decimalfieldto a fileexcel2007 (.xlsx).
IfI exporttoan excel filein 2003 I DON'Thave anykind of problem.

The problem is thatwhen I exportthefield ofmoney,thatsqlhasthe dot as separator,the dotis maintained inexceldoes not recognize thetypeof field. (
I work inItalywhere the separatoris a comma)

in this link(http://i62.tinypic.com/10qm4c4.jpg)you can seethe problem clearly.

I writeherethe code of thetable definition,although very simple.

CREATETABLE[dbo].[tblOrders]([OrderID][int]NULL,[OrderDate][smalldatetime]NULL,[OrderPriceM][money]NULL,[OrderPriceD][decimal](18,6)NULL)ON[PRIMARY]
GO/* insert data */insertinto tblOrders values(1,'2014-10-25',24.23,24.23);insertinto tblOrders values(2,'2014-10-21',100,100);insertinto tblOrders values(3,'2014-10-11',-22.87,-22.87);

Thanks

Charles

SSIS Issue in Visual Studio 2005

$
0
0
Trying to create a new SSIS Package in Visual Studio 2005, and I keep getting this error message:

"Object reference not set to an instance of an object".  

Declare Global Variable ActiveX (visual basic) Script task SSIS 2005

$
0
0

hi to all

I'm migrating a visual basic script from DTS 2000 to SSIS 2005.

In DTS 2000 visual basic script we declare global variables through the "Option Explicit" Statement and this
variables are used in all Functions within the script.

In SSIS 2005 activeX script task we can not use the "Option Explicit" Statement because we get the error when the script return.

If I declare the variables in the Main function I can use it only in the main function , in the other functions are not visible.

So, how to we declare Global variables in a visual basic script in SSIS 2005??

Thanks in advance!





SQL Agent not running Script in Package which calls an Excel containing Macro

$
0
0

I have a script task in SSIS package which calls Excel VBA file containing Macro, this file is on the local drive, when I run this package through SSDT the package works ok and the macro does what it needs to. However when I set up a sql agent job to call the package then it fails at the Script task. I have created a credentials and proxy user as my self so I should Have full rights.

But it fails through the job and not through SSDT, can you advise ?

SSIS package - send records to webservice

$
0
0

Hello Guys
 
I am facing one issue on ssis.
I have to fatch 100 record with pending status from DB and send to web service. on response of web service would get same 100 record and same need to update with completed status in DB. Now again I have to fatch 100 record with pending status..... so I have to execute ssis package till record with completed status.
plz let me know how I can execute ssis package till all record update.


Loading Excel Sheet data in to another Excel sheet by using a package

$
0
0

 

Hi All,

 

I would like to load data from a simple excel sheet in another excel sheet like i have data in this format in excel sheet1$

 

Some header
Another header
Still another header
EmployeeIDLastNameFirstName
1DavolioNancy
2FullerAndrew
3LeverlingJanet
4PeacockMargaret
5BuchananSteven
6SuyamaMichael
7KingRobert
8CallahanLaura
9DodsworthAnne

 

 

I would like to load this data in another excel sheet or else in same excel sheet2$.

Output:

EmployeeIDLastNameFirstName
1DavolioNancy
2FullerAndrew
3LeverlingJanet
4PeacockMargaret
5BuchananSteven
6SuyamaMichael
7KingRobert
8CallahanLaura
9DodsworthAnne

 

How can i do implement this logic in a package.I have tried it but still not getting.

Any replies i will be grtful...

 

 

a task of getting an extra column using ssis

$
0
0

hi...

I need a help in solving this task. I did this in sql but don't know, why I am getting error in ssis.

the task is about creating a new column, in this column I should get the id in such a way that the first two letters and the last two letters before @ are displayed and other letters are replaced by *.

my source column:                                               MY DESTINATION COLUMN

ID  NAME    EMAILID                                              ID    NAME         EMAILID                    NEWEMAILID

1   AKHI     AKHI1985@                                          1      AKHI         AKHI1985@               AK****85@

2 SRESHTA SRESH_GG@                                        2      SRESHTA  SRESH_GG@              SR****GG@     

3 RENU      RENU_COOL1989@                               3       RENU       RENU_COOL1989@     RE********89@

please solve this.

Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state

$
0
0

we have developed packages to do the followings

Extract data from DB2 Source and put it in MS Sql Server 2008 database (Lets Say DatabaseA).From MS Sql Server 2008 (DatabaseA) we will process the data and place it in another database MS Sql Server 2008 (DatabaseB)

We have created packages in BIDS..We created datasource connection in Datasource folder in BIDS..Which has DB2 Connection and both Ms Sql Server connection (Windows authentication-Let say its pointing to the server -ServerA which has DatabaseA and DatabaseB).The datasource connections will be used in packages during development.

For deployment we have created Package Configuration which will have both DB2 Connection and MS SqlServer connection in the config

We deployed the packages in different MS SqlServer by changing the connectionstring in the config for DB2 and MS SqlServer...

While runing the package we are getting the following error message

Code: 0xC0016016     Source:       Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.


ilikemicrosoft

SSIS 2008 - Sending file with dynamic name using FTP task

$
0
0

Hi  - Thanks for taking a look -  (I'm very new to SSIS.)

I'm trying to create an SSIS 2008 package that does the following:

1) Execute a stored procedure on SQL.

2) Download the results as a CSV file to a 'local' location.  The file name is set using a variable ("User::LocalFilePath") dynamically based on the current time:

@[User::LocalFilePath] + "GreatReportName_" + "_" +(DT_STR,4,1252) DatePart("yyyy",getdate()) + Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) + "_" + Right("0"+ (DT_STR,4,1252) DatePart("d",getdate()),2) + "_" + Right("0" + (DT_STR,4,1252) DatePart("hh",getdate()),2) +  "_" + Right("0" + (DT_STR,4,1252) DatePart("mi",getdate()),2)+ "_" +  Right("0" + (DT_STR,4,1252) DatePart("ss",getdate()),2) + ".csv"

3) Transfer the CSV file to an FTP site.

4) Delete the CSV file from the 'local' location.

I've been able to do steps 1 and 2 so far.  However when trying the move the newly created file to the FTP site I get the error:

"Error: 0xC002917C at Send to FTP, FTP Task: The variable "User::LocalFilePath" doesn't contain file path(s)."

(When I set the "IsLocalPathVariable" to "False" and use a file previously created the file is correctly transferred to the FTP site.  This proves that the FTP details are correct and that the "RemotePathVariabe" is working correctly.)

I have set the variable ("User::LocalFilePath") to "EvaluateAsExpression" in the variable properties.

Can anyone help?

Many Thanks,

UnoT

Extract data from Active Directory

$
0
0

Hi, I want to extract 2 columns (Mail, SamAccountName) from LDAP. I have tried ADO.Net connection but it is throwing error ("ADsDSOObject" Failed) after extracting 600 rows. I even tried few scripts availabe online but none of them worked, can anyone provide me a script that I can use in script task in DFT and extract these columns.

Thanks 


Royal Thomas


execute script task error due to Could not find endpoint element with name 'WSHttpBinding_IBIDataService' and contract 'BIData.IBIDataService' in the ServiceModel client configuration section. This might be because no configuration file was found for your

$
0
0

Hi i am getting this error can you anyone guide me as soon as possible 

Error: 0x1 at Script Task: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Could not find endpoint element with name 'WSHttpBinding_IBIDataService' and contract 'BIData.IBIDataService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.

i have app.config file 

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IBIStreamService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="Transport">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
                <binding name="BasicHttpBinding_IBIStreamService1" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
            <wsHttpBinding>
                <binding name="WSHttpBinding_IBIStreamService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Transport">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            establishSecurityContext="true" />
                    </security>
                </binding>
                <binding name="WSHttpBinding_IBIStreamService1" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="None">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            establishSecurityContext="true" />
                    </security>
                </binding>
                <binding name="WSHttpBinding_IBIDataService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Transport">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            establishSecurityContext="true" />
                    </security>
                </binding>
                <binding name="WSHttpBinding_IBIDataService1" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="None">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            establishSecurityContext="true" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="https://service4.ultipro.com/services/BIStreamingService"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IBIStreamService"
                contract="BIStream.IBIStreamService" name="WSHttpBinding_IBIStreamService" />
            <endpoint address="https://service4.ultipro.com/services/BIStreamingService"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IBIStreamService"
                contract="BIStream.IBIStreamService" name="BasicHttpBinding_IBIStreamService" />
            <endpoint address="https://service4.ultipro.com/services/BIDataService"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IBIDataService"
                contract="BIData.IBIDataService" name="WSHttpBinding_IBIDataService" />
        </client>
    </system.serviceModel>
</configuration>

ScriptMain.cs file

                              

using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;


//-----------------------Added----------------------------------
using System.IO;
using System.ServiceModel;
using ST_5095d041500f4a1cbd7e67c6e36b98e2.csproj.BIData;
using ST_5095d041500f4a1cbd7e67c6e36b98e2.csproj.BIStream;
//--------------------------------------------------------------



namespace ST_5095d041500f4a1cbd7e67c6e36b98e2.csproj
{  


    [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
    public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
    {


        #region VSTA generated code
        enum ScriptResults
        {
            Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
            Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
        };
        #endregion


        public  void Main()
        {

            string reportpath = Dts.Variables["ReportPath"].Value.ToString();
            BIDataServiceClient dataClient = null;

            // Step 1: Create the proxy to the data service
            dataClient = new BIDataServiceClient("WSHttpBinding_IBIDataService");

            // Step 2: Logon the user to retrieve his/her data context
            DataContext context =
                dataClient.LogOn(
                    new LogOnRequest
                    {
                        ClientAccessKey = "ABWC44VYC22",
                        UserName = "samrani",
                        Password = "Meditel",
                        UserAccessKey = "RCNS"
                    });


            // Step 3: Submit a report request
            ReportResponse response =
                dataClient.ExecuteReport(
                    new ReportRequest
                    {
                        ReportPath = "/content/MyFolder/Myreport1"
                    },
                    context);

            bool err = true;
            // Step 4: Get the report from the streaming service if the status is success
            if (response.Status == ReportRequestStatus.Success)
            {
                GetReportStreamFromResponse(response);
                err = true;
            }
            else
            {

                err = false;
            }


            // Step 5: Logoff the user from the data service
            dataClient.LogOff(context);

            if (err)
            {
                Dts.TaskResult = (int)ScriptResults.Success;
            }
            else
            {
                Dts.TaskResult = (int)ScriptResults.Failure;
            }


        }
        private void GetReportStreamFromResponse(ReportResponse response)
        {
            string Filepatch = Dts.Variables["Patch"].Value.ToString() + "\\" + Dts.Variables["FileName"].Value.ToString();
            string msg;
            Stream input = null;
            BIStreamServiceClient streamClient = null;
            try
            {

                streamClient = new BIStreamServiceClient("WSHttpBinding_IBIStreamService", new EndpointAddress(response.ReportRetrievalUri));


                ReportResponseStatus status;
                do
                {
                    status = streamClient.RetrieveReport(response.ReportKey, out msg, out input);
                } while (status == ReportResponseStatus.Working);


                if (status == ReportResponseStatus.Failed)
                {
                   // Console.WriteLine("Failed to retrieve report due to \"{0}\"", msg);
                    return;
                }


                using (StreamReader reader = new StreamReader(input))
                {


                    using (Stream output = new FileStream(Filepatch, FileMode.Create, FileAccess.Write))
                    {
                        using (StreamWriter writer = new StreamWriter(output))
                        {
                            int bytesRead;
                            char[] buffer = new char[1024];
                            while ((bytesRead = reader.Read(buffer, 0, buffer.Length)) > 0)
                            {
                                writer.Write(buffer, 0, bytesRead);
                            }
                        }
                    }
                }
            }
            finally
            {

                if (input != null)
                {
                    input.Close();
                }


                CloseClientProxy(streamClient);
            }
        }


        public static void CloseClientProxy(ICommunicationObject client)
        {
            if (client == null) return;


            if (client.State != CommunicationState.Faulted)
            {

                try
                {
                    client.Close();
                }
                catch
                {
                    client.Abort();
                }
            }
            else
            {
                client.Abort();
            }
        }


    }
}

Please tell me where is something missing

Colum "A" can not convert between unicode and non-unicode string data type.

$
0
0

I an pretty much green in MSBi.

While I am transferring data from SQL to Excel. it is giving me error colum "A" can not convert netween Unicode and non Unicode string data type.

I checked the mapping is alright.

Any idea pls.

change column data into two rows and assign particular value to corresponding record in another column regarding....

$
0
0

HI all,

I'm new to this forum,i met with one situation:

i have three columns of numeric type,that i want to put in two columns as CREDIT AND DEBIT for the corresponding record i have to assign some unique varchar value depending on a category i.e(some categories are there each has unique varchar value that i hve mentioned.)

for ex:

id            col1,col2.col3 

1            123,345,567

i need to get like this....

id               credit debit    uniquecolumn

1                123              abccc

1                345               yuipyp

1                567                tuyooy

Inserting data to excel

$
0
0

HI !

I have a table which has got QTY as column, When i insert the data to excel , The data type of inserted data should be Numeric in excel.

Actually now it is in String format.


Regards,


SQL0104 IBM DB2

$
0
0
I'm migrating my server from Windows Server 2008 to Windows Server 2012 R2, and when i execute some queries show me this error, but in Windows Server 2008 execute correctly.
Viewing all 24688 articles
Browse latest View live




Latest Images