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

How to use the for loop and checking same process in ssis 2008

$
0
0

Hi,

i have one table that name is sample. this table contains three fields like f1,f2,f3
f1 is int, f2 and f3 char data types
f1 columns data like this 1,2,3,..n

i want f1 column value 1 means,it move  to sample_1,
f1 column value 2 means, it move to sample_2. same for all values...

this statical process means,using conditional split and move to different ole db destination.
but i want dynamic process... because f1 columns may be n values..

this same process for ten different tables..
please help me..

Regards,

Abdul Khadir.M


HTML Table Formatted E-Mail using SSIS (Script Task)

$
0
0

Hi,

Can someone show me how I can add a table in body of the e-mail which would have the heading row (bg color/font = bold, etc) and then multiple detail rows. These detail rows would be pulled from SQL query (can be 1 or 100).

I want e-mail to have HTML formatted tables.

Thank you


For loop inside For Loop (Nested For Loops)

$
0
0

Hi,

I have sequence container, in which there are nested loops. When i execute the container it works fine (it loop thru each year and each Year Month), but when execute the whole package it just stop at first value of inner loop Year_Month, donot go forward with incrementing the values.

Year is 2009 till 2013, It takes first value 2009 for outer loop and then for that value 2009 it loops thru (200901-200913). When i excute whole package it stop at 200901, do go ahead.

Below is the logic.

Am I missing something. Please advice. Any help is appreciated.

Thanks,

Punia

How I will set up the SMTP connection in SMTP connection manager for SEND MAIL TASK in SSIS

$
0
0

Hi,

Now to work on automation tasks,

I have to run the SSIS package by scheduled as a SQL Server Agent Job.

and in Package I created a SEND MAIL task if the Package failure.

So SEND MAIL task, It need SMTP connection, I dont Know anything about SMTP

How I will set up the SMTP connection in SMTP connection manager for SEND MAIL TASK in SSIS ?

Please do help

Thanks

Madhu

SSIS freeze when copying data from a view - works fine when copying from a table

$
0
0

I have a view with 7876 records. When copying from that view to a table in another DB using SSIS, SSIS freezes.

If I insert the 7876 records into a temporary table, it takes 1 second. If I then copy the 7876 records from the temporary table to the table in the other DB using SSIS it takes 1 second. I do not understand why copying the same data from a table works, when it does not work when copying the data directly from a view.

I could of course make a temporary table for every view I would like to copy data from, but having more than 200 views, I would like to avoid that clumsy work-around.

Does anybody have the explanation why copying directly from a view does not work?

I am using SQL Server 2008 R2 SP2.

automatic mail when condition will true.

$
0
0

Hi

I have table I need to get automatic mail when condition is true like

select count(keyID)  from table

where order is null

having count(keyID)<40

what are the diffrenet ways to do this ?Please help me with some steps / code.

Thanks & Regards

BI_Group

ssis toolbox

$
0
0

Hello all,

              Unknowingly I did reset toolbox, Now my tool box not showing anything. can any please tell me what to do, to show up all the tasks over here.

It just says 'there are no usable controls in this group blah blah blah'

Thanks.

Calling web service using SSIS script task. Request and response

$
0
0

Hi,

I was given a webservice url and has different webmethods. I want to call this web service and generate the request and get the response.

I need to consume this using SSIS script task. I can't use web service task as the WSDL file has complex types which is not supported.

I am able to call the web service using HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strURL);

How do I get the SOAP envelop XML string?

I need to use the SOAP envelop xml string as

XmlDocument soapEnv = new XMLDocument();

soapEnc.LoadXml(soapenvxml);

thanks


LookUp problem

$
0
0

Hi All,

I am inserting 3000 records in to the table from flat file.Table has 40million records.While inserting data after look up it is showing yellow color and there only such a long time .the record counts also not increasing.

Any idea/suggestion why it is showing yellow color only and not inserting any data.

Thanks,

Ramu

Monitor folder and move files

$
0
0

Hi,

We have a folder where a file will be dropped in (.csv, or .xml) by a user.  When the file lands in this folder, we need to automatically move it to an archive folder (on the same server) AND insert a row into a sql server database.

This process needs to happen automatically when the file lands in the initial folder.

Is SSIS the best way to do this (bearing in mind we will be using SSIS 2005)?

Or should we use some other method?  

Scheduled Integration Services Job not listed in Management Studio

$
0
0

I recently started performing DBA functions for SQL Server 2005, and a request came in that I change a scheduled reporting job. Unfortunately, the person who created the scheduled job didn't document how he scheduled it.

I looked in the SQL Server Agent, and no luck. In addition, the job isnt even listed when I connect to Integration Services. I know its an Integration Services job, because I can see the Windows Event Logs for it when it runs. I also checked Scheduled Tasks, and it was not there either.

Does anyone know what other way an Integration Services job could be run on a schedule? I personally have scheduled other jobs using the SQL Server Agent, but this has been beyond my grasp to figure out.

SSIS Log Provider for SQL Server

$
0
0

Using SQL Server 2008 R2.

I created a package that imports an excel file into several SQL Server tables. For test purposes, I have added errors to this package. Using BIDS, I turned on SSIS logging. I have checked onError and onTaskFailed. If I run the package interactively by double clicking the file, the errors are  written to sysSsislog table in SQL Server. However, if I run the package via a SQL Server agent job, the package still errors out, but does not write the errors to sysSsislog table.

Within the job under the Job Step Properties, I have turned on (I think) logging via the Logging tab. The log provider isSSIS log provider for SQL Server. The configuration string points to the package OLEDB connection to SQL Server.

What am I missing? Why does the package write the errors to sysssislog when I run the program via a job?

Any help will be highly appreciated.

SSIS 2008 Oracle 11g On 64 bit Linux

$
0
0

I am completely new to SSIS.  I am sorry if I am stupid with questions

I am not able to connect to Oracle Database using connection manager in SSIS 2008. I keep getting

"ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA".

We have Oracle Database 11g Release 11.2.0.3 - 64 bit loaded on production.

TNS for Linux

I am using SSIS 2008 on Windows 7 64 bit machine.

I am able to access Oracle database using SQL Developer.

with the following look a like credentials

Oracle DB server IP 172.xx.x.xx
Oracle DB/Service  name XYZ
Listener port 1521
Host name ZYX

I dont know what oracle client I should download for connecting. A linux one or windows one.

Not sure if some one asked the same quesiton but please help me out.

This issue took my 2 days. Havent even close to resolving it.

Thanks in advance.


Inayat Syed

SSIS Dynamically + Export excel + Column not mapping

$
0
0

Hi ,

I Have SSIs which doing export from SQL DB to Excel , i am using Data Conversion for cast data, everything seems work, but when i case data from , my Destination Data not mapping becuase , column name looks chnage by using prefix.

how i can fix code below

very helpful this code.

Microsoft.SqlServer.Dts.Runtime.Application SIFISO_app = new Microsoft.SqlServer.Dts.Runtime.Application();


                //Adding Connection Manger
                Package package = new Package();
                ConnectionManager ConMgr = package.Connections.Add("OLEDB");
                ConMgr.ConnectionString = ""
                ConMgr.Name = "SourceConnectionOLEDB";
                ConMgr.Description = "OLE DB connection to the AdventureWorks2008R2 database.";

               
                Executable e1 = package.Executables.Add("STOCK:PipelineTask");
                TaskHost thMainPipe = e1 as TaskHost;
                thMainPipe.Name = "Data Flow Task 1";
                //thMainPipe.Properties["Connection"].SetValue(thMainPipe, "SourceConnectionOLEDB");
                MainPipe dataFlowTask = thMainPipe.InnerObject as MainPipe;

               // string Conn = "Data Source=S4UAGP-PC\\ASHOKINSTANCE;Initial Catalog=MMBD;Integrated Security=True";
                // Create the source component.  


                ///Adding Source
                ///
                IDTSComponentMetaData100 srcComponent =   dataFlowTask.ComponentMetaDataCollection.New();
                srcComponent.ComponentClassID = "DTSAdapter.OleDbSource";
                CManagedComponentWrapper srcDesignTime = srcComponent.Instantiate();
                srcComponent.Name = "Source - MMBD_LN_MSTR1";
                //srcComponent.Description = "OLE DB Source";
                IDTSDesigntimeComponent100 srcDesignTimeComponent = srcComponent.Instantiate();
                srcDesignTimeComponent.ProvideComponentProperties();

                // Configuring  it to read from the given table
                //srcDesignTimeComponent.SetComponentProperty("AccessMode", 2);
                //srcDesignTimeComponent.SetComponentProperty("SqlCommand", "SELECT  * FROM   [MMBD_LN_MSTR]");

                srcDesignTimeComponent.SetComponentProperty("AccessMode", 0);
                srcDesignTimeComponent.SetComponentProperty("OpenRowset", "[dbo].[MMBD_LN_MSTR1]");

                // Setting the connection manager
                srcComponent.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.GetExtendedInterface(ConMgr);
                srcComponent.RuntimeConnectionCollection[0].ConnectionManagerID = ConMgr.ID;
                srcDesignTime.AcquireConnections(null);
                srcDesignTime.ReinitializeMetaData();





                ////Adding Data Conversion

                IDTSComponentMetaData100 dataConvertComponent = dataFlowTask.ComponentMetaDataCollection.New();
                dataConvertComponent.ComponentClassID = "DTSTransform.DataConvert";
                dataConvertComponent.Name = "Data Convert";
                dataConvertComponent.Description = "Data Conversion Component";

                CManagedComponentWrapper conversionInstance = dataConvertComponent.Instantiate();
                conversionInstance.ProvideComponentProperties();

                conversionInstance.AcquireConnections(null);
                conversionInstance.ReinitializeMetaData();

                // Connect the source and the transform
                dataFlowTask.PathCollection.New().AttachPathAndPropagateNotifications(srcComponent.OutputCollection[0], dataConvertComponent.InputCollection[0]);

                IDTSOutput100 output = dataConvertComponent.OutputCollection[0];
                IDTSVirtualInput100 virtualInput = dataConvertComponent.InputCollection[0].GetVirtualInput();

                int inputId = dataConvertComponent.InputCollection[0].ID;
                
                foreach (IDTSVirtualInputColumn100 vColumn in virtualInput.VirtualInputColumnCollection)
                {
                    string test = vColumn.DataType.ToString();
                    //if (vColumn.Name == "REC_CRE_DT") MessageBox.Show("ff");
                    Microsoft.SqlServer.Dts.Runtime.Wrapper.DataType dtype = new Microsoft.SqlServer.Dts.Runtime.Wrapper.DataType();
                    dtype = getSSISDataTypes(vColumn.DataType);
                    if (dtype != Microsoft.SqlServer.Dts.Runtime.Wrapper.DataType.DT_STR)
                    {
                        IDTSInputColumn100 inputColumn = conversionInstance.SetUsageType(inputId, virtualInput, vColumn.LineageID, DTSUsageType.UT_READONLY);
                        IDTSOutputColumn100 outputColumn = conversionInstance.InsertOutputColumnAt(output.ID, 0, vColumn.Name, string.Empty);
                        conversionInstance.SetOutputColumnDataTypeProperties(output.ID, outputColumn.ID, dtype, 1000, 0, 0, 0);
                        outputColumn.CustomPropertyCollection[0].Value = inputColumn.LineageID;
                    }
                    else
                    {
                        IDTSInputColumn100 inputcolumn = conversionInstance.SetUsageType(inputId, virtualInput, vColumn.LineageID, DTSUsageType.UT_READONLY);
                        IDTSOutputColumn100 outputColumn = conversionInstance.InsertOutputColumnAt(output.ID, 0, vColumn.Name, string.Empty);
                        conversionInstance.SetOutputColumnDataTypeProperties(output.ID, outputColumn.ID, dtype, 20, 0, 0, 1252);
                        outputColumn.CustomPropertyCollection[0].Value = inputcolumn.LineageID;
                    }
                }

                conversionInstance.ReleaseConnections();
               

                ////Adding Destination
                ConnectionManager SconMgr = package.Connections.Add("EXCEL");
                SconMgr.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\tesing.xls;Extended Properties=""Excel 8.0;HDR=Yes""";
                SconMgr.Name = "ExcelConnection";


                IDTSComponentMetaData100 destComponent = dataFlowTask.ComponentMetaDataCollection.New();
                destComponent.ComponentClassID = "DTSAdapter.ExcelDestination";
                CManagedComponentWrapper srcDesignTime1 = destComponent.Instantiate();
                destComponent.Name = "Source - MMBD_LN_MSTR1";
                //destComponent.Description = "OLE DB Source";
                IDTSDesigntimeComponent100 srcDesignTimeComponentdest = destComponent.Instantiate();
                srcDesignTimeComponentdest.ProvideComponentProperties();

                srcDesignTimeComponentdest.SetComponentProperty("AccessMode", 0);
                srcDesignTimeComponentdest.SetComponentProperty("OpenRowset", "Excel Destination");

                destComponent.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.GetExtendedInterface(SconMgr);
                destComponent.RuntimeConnectionCollection[0].ConnectionManagerID = SconMgr.ID;

                //dataFlowTask.PathCollection.New().AttachPathAndPropagateNotifications(dataConvertComponent.OutputCollection[0], destComponent.InputCollection[0]);
                dataFlowTask.PathCollection.New().AttachPathAndPropagateNotifications(dataConvertComponent.OutputCollection[0], destComponent.InputCollection[0]);

                ////Mapping

                // Get the destination's default input and virtual input.
                IDTSOutput100 outputdest = destComponent.OutputCollection[0];
                IDTSVirtualInput100 virtualInputdest = destComponent.InputCollection[0].GetVirtualInput();
                IDTSInput100 inputdest = destComponent.InputCollection[0];


                
                string dd = destComponent.InputCollection[0].InputColumnCollection.ToString();
               
                //foreach (IDTSVirtualInputColumn100 vColumn in virtualInputdest.VirtualInputColumnCollection)
                //{
                //    srcDesignTimeComponentdest.MapInputColumn(inputdest.ID, virtualInputdest.ID, outputdest.ExternalMetadataColumnCollection[vColumn.Name].ID);
                //}
              


             

                SIFISO_app.SaveToXml("D:\\C Drive\\Desktop\\DataExportWizard_Source\\SSIS\\SSIS\\pkg_Execute_Sql_Tasks.dtsx", package, null);

               
                DTSExecResult pkgResults = package.Execute();

                if (pkgResults == DTSExecResult.Success)
                    Console.WriteLine("Package ran successfully");
                else
                    Console.WriteLine("Package failed");


Jumpingboy


new to ssis

$
0
0

hi all

am new to ssis

i created one simple package with lookup

table 1 with  2 fields (id and country name)

id countryname 

1 ind

2 china

3 japan

table 2  only one field country name

country name

ind

Eng

USA

am reading data from oledb source thn i created one lookup its workin fyn also

but its performing like inner join, 

is it possible to perform like outerjoin or any other joins ???

suggest me some ideas

thanx in advance





Winscp Error

$
0
0

Good Morning All,

I have to grab files from a remotes server, for this created a .txt file on my local machine and then i created a package and used the 'Execute Process Task'. When i run the job i can see in the winscp command line utility that its connecting to the remote host and gets authenticated after that i get the follwing error message:

[Execute Process Task] Error: In Executing "C:\Program Files (x86)\WinSCP\WinSCP.com" "-script=C:\sftpscript.txt" at "C:\Program Files (x86)\WinSCP", The process exit code was "1" while the expected was "0".

Can any one please guide mein the right direction?

Thanks

XML to database table - XML Task or XML Source in this scenario

$
0
0

Hello community,

I want to transform xml documents of the same structure and import them via SSIS toONE sql server table.

My xml file structure: This structure has already been flattened with XSLT.

<?xml version="1.0" encoding="UTF-8"?><processes><process><processNr>1</processNr><processName>Process 1</processName><subprocess>
<subprocessNr>1</subprocessNr><subprocessName>SubProcess 1 of Process 1</subprocessName>
<input/><output/><activity><activityNr>1</activityNr><activityName>Activity No 1</activityName><description> Text 1</description></activity>
<activity><activityNr>2</activityNr><activityName>Activity No 2</activityName><description>Text 2
</description></activity></subprocess><subprocess><subprocessNr>2</subprocessNr>
<subprocessName>SubProcess 2 of Process 1</subprocessName><input/><output/><activity>
<activityNr>1</activityNr><activityName>Activity No 1</activityName><description> Text 1</description></activity><activity><activityNr>2</activityNr><activityName>Activity No 2</activityName>
<description>Text 2</description></activity></subprocess></process><process><processNr>2</processNr>
<processName>Process 2</processName><subprocess><subprocessNr>1</subprocessNr>
<subprocessName>SubProcess 1 of Process 2</subprocessName><input/><output/><activity>
<activityNr>1</activityNr><activityName>Activity No 1</activityName><description> Text 1</description></activity><activity><activityNr>2</activityNr><activityName>Activity No 2</activityName>
<description>Text 2</description></activity>
<activity><activityNr>3</activityNr><activityName>Activity No 3</activityName>
<description>Text 3</description></activity>
</subprocess>
</process></processes>

How can I now load those three "for-each"-elements (process, subprocess, activity) into a single table?

A dataflow with XML Source and merge join only works with two elements or is there a way to join all three elements?

Or do I need to work with an XML-Task here?

Thank you.

Hot get Todays Files from a folder into an object variable using script task

$
0
0

Hi,

I'm looking to get todays files   from a folder into an object variable  with the file name,date and time   using script task ,My aim is to process all files which arrive till a particular hour in a day for that day. 

Many Thanks


Insert Global Variable into table

$
0
0
I have a loop task in my ssis package, where I am reading a new file. The file name is being stored in a package global variable, then I load the contents into a table within a data flow task. My question is, how do I also load the file name global variable as part of each row being uploaded to the table?

Winscp Error

$
0
0

Good Morning,

I have Execute Process task in my package. I have winscp on my pc. when i execute the task after connecting the host and transferring the files to the destination location, the task still shows in YELLOW, i have to manually type EXIT in the Winscp and then the task turns GREEN. I have the following code in my script

option batch on
option confirm off
open sftp://UserName:Password@SFTPServer

cd .
option transfer binary
get -preservetime *.txt H:\sftpfiles\
close
exit//<username>:<password>

In the Winscp window after transferring all the files i'm seeing the message

Unknow command 'exit//<usernmae>:<password>'

My second iproblme with winscp is, on the DEV server i have the winscp installed and when i executed the same package , i'm getting the following error:

The Server's host keywas not found in the cache. You have no guarantee that the server is the computer you think it is. The Server's fingerprint is ........... If you trust this host press YES. To connect without adding host to the cache press NO. To abandon the connection press Cancel. I'm running this manually and the winscp wont give me a chance to press any option, also it would be a problem once i automate it.

Please need help.

Thanks

Viewing all 24688 articles
Browse latest View live


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