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

SSIS 2012 - creating an sript task using connection manager

$
0
0

I'm trying to write the code to connect to a connection manager in SSIS SQL server 2012 - I'm using the examples but the references for Dts don't appear to be working. I've the following namespaces imported:-

#region Namespaces
using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using Microsoft.SqlServer.Dts.Runtime;

The code I'm trying to execute is :-

object rawConnection = Connections.SCCDWDEV.AcquireConnection(null );
        SqlConnection _connSCCDWDEV = (SqlConnection)rawConnection;

        SqlCommand _sqlcmd = new SqlCommand();
        _sqlcmd.Connection = _connSCCDWDEV;
        _sqlcmd.CommandType = CommandType.Text;
        _sqlcmd.CommandText = "Select URN, Establishment_Name, LA_CODE, Establishment_Number, Closed_Date, schoolDetailsCode FROM dimSchoolDetails where LA_CODE = " +
            Row.CopyofLACODE.ToString() + " and Establishment_Number = " + Row.CopyofEstab.ToString();
        SqlDataReader _reader = _sqlcmd.ExecuteReader();

Any help greatly appreciated.  All of the BOL page I find talk about using the dts.xxxxxx but as I say I can't get this to resolve and I can't find any references toinclude in my project that resolve the issue either.  Totally confused!

Thanks,

Tim


Thank you for you time folks!


SSIS load excel with long string failed.

$
0
0

I'm using SSIS to load excel files into IBM netezza.

In the excel, there are three columns larger than 1000. And I always get following errors in sequence. I cannot find any useful info from the error information. 

The typical failure performance is while there are 1000 records, SSIS get stuck at 449th records and then a black window pomp up. Seems like some bug in SSIS.

Please help!!!!!!!!!!!!!!!!!!!1

[OLE DB Destination [216]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available.  Source: "Netezza Performance Server"  Hresult: 0x80004005  Description: "ERROR:  External Table : count of bad input rows reached maxerrors limit".
An OLE DB record is available.  Source: "Netezza OLE DB Provider"  Hresult: 0x80004005  Description: "Operation canceled".

[OLE DB Destination [216]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "OLE DB Destination.Inputs[OLE DB Destination Input]" failed because error code 0xC020907B occurred, and the error row disposition on "OLE DB Destination.Inputs[OLE DB Destination Input]" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.

[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "OLE DB Destination" (216) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (229). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.

[Excel Source [2]] Error: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.


[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on Excel Source returned error code 0xC02020C4.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.

Directing Rows (and Columns) in a Script Transformation

$
0
0

I have a very wide record set I need to run through a script transformation.

In this transformation, I need to examine the contents of a column and redirect asubset of the input columns to an output when a particular value is found.

All other rows (and all columns) not meeting the condition need to go to a different output.

Is it possible to "pass through" the entire column set on one output and output specific columns on another?

Thanks all.

Data Loading from one table to another in the Same Database based on conditions .

$
0
0

Hi ALL ,

I have 2 tables Products and Product_info .

Product_info table Product_id is Primary key but not an identity column so auto increment of number needs to be performed from the Package only .

Requirement is :

IF the Product_ID is = 20 and Date lies in the previous month not the current month in the Products table then 

insert into the Product_info table based on below mentioned information .

1.If the Name  has tap then ignore it completely don't perform any insert for it.

2.If the Name has Zork in it then perform 2 inserts in the Product_info table having Product_info_id's 1 and 2 .

3.If the Name doesn't contains Zork or tap insert it in the Product_info table having Product_info_id 4.

Very new to SSIS package development it will be helpful if you can provide detailed information .

Source Table (Products table )

ID NAME Product_ID Date  Area_ID
1 P_tap_rus 20 13-01-2014 3
2 Enc_sap_top 10 15-01-2014 4
3 Yorl 20 05-02-2014 5
4 zork 20 20-01-2014 6
5 fadbt 10 22-01-2014 6
6 xyzzz_oprt 20 28-01-2014 5
7 def_type_ru 20 06-02-2014 2
8 acd_inc_tup 10 07-02-2014 3
9 bnf_dlk_fbg 20 03-02-2014 4
10 rtyui_vnmghj_sfdl 10 12-01-2014 5
11 wlwf_10103_123 10 04-02-2014 9

Destination table  (Product_info)

Please let me know if any other information is required .

Thanks

Priya

Porduct_ID ID Area_ID  Product_info_ID Column1
1 3 5 4 As NameString doesn’t contain Zork or Tap 
2 4 3 1 As Id is 4 so 2 inserts one for 1 and other for 2 in the Product_info_id column
3 4 3 2
4 6 5 4
5 10 5 4
6 11 9 4

Retrieve specific info from Diff tables based on field in one table

$
0
0

Please look at this picture. I want to display date  field from each table based onitem_type in my Receipt_item table .

Regards,

Salman

Deploy SSIS 2012 Environments

$
0
0

Hey,

What's the easiest way to also deploy my Development environment with all its variable to my acceptance/production environment?


Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter


how to handle comma separated values in OLE DB Source query for a parameter variable from XML file in SSIS

$
0
0

Hi,

I am using OLE DB Source to fetch the records with Data Access Mode as SQL COMMAND which is using the below query with a parameter,

SELECT CON.Title,CON.FirstName,EMP.MaritalStatus,EMP.Gender,EMP.Title AS Designation, EMP.HireDate, EMP.BirthDate,CON.EmailAddress, CON.Phone
from HumanResources.Employee EMP INNER JOIN Person.Contact CON ON EMP.ContactID=CON.ContactID WHERE EMP.Title in (?) 

In this query for the parameter I am passing the value from a variable and which is configured (XML Configuration). While passing valueBuyer it works correctly. But while passing values Accountant,Buyerit is not working as expected.
How to handle while passing such multiple values Or is it possible to pass such values or not in SSIS 2012 ?

Kindly help me to find a solution.

NOTE: I placed the whole query in a variable as a expression as below it is working fine.

"select CON.Title,CON.FirstName,EMP.MaritalStatus,EMP.Gender,EMP.Title AS Designation,EMP.HireDate,EMP.BirthDate,CON.EmailAddress,CON.Phone from HumanResources.Employee EMP
INNER JOIN Person.Contact CON ON EMP.ContactID=CON.ContactID WHERE EMP.Title in ('" + REPLACE(@[User::temp],",","','")  +"')"


Any other solution is there ? without placing the query in a variable. May be a variable can have some limitations for no. of characters stored not sure just a thought.


Sridhar



Split flat file column data into multiple columns using ssis

$
0
0

Hi All, I need one help in SSIS.

I have a source file with column1, I want to split the column1 data into
multiple columns when there is a semicolon(';') and there is no specific
length between each semicolon,let say..

Column1:
-------
John;Sam;Greg;David

And at destination we have 4 columns let say D1,D2,D3,D4
I want to map
John -> D1
Sam->D2
Greg->D3
David->D4

Please I need it ASAP

Thanks in Advance,

RH

 


sql

SAP BW connector in SSIS

$
0
0

Hi,

I am trying to connect to SAP BW using SSIS SAB BW Source.

But while setting up SAP BW SOurce, SSIS asks for a REQUEST ID. 

Could someone please help me understand from where to get this REQUEST ID.

Importing Date fields from Oracle always defaults to DT_DBDATETIME, and won't accept chages

$
0
0

Hi

I am trying to import date fields in an Oracle database in to SQL Server 2012, using SSIS. The package is using DT_DBTIMESTAMP type in the Data Flow, but this has the same range as SQL Server datetime, and it bombs out all the time.

I have tried to change the type used to DT_DBDATE, but no matter what I do the data type on the input columns is readonly and will not change.

Any help would be much appreciated

Andy


CRM 4, SQL Server and .Net developer using C#

import excel fiel to sql server 2012,althout i set colum in excel file as "text" or "general" but still "task-import" treat it as float

$
0
0

hi

   i'd like to ask a question

  import excel fiel to sql server 2012,althout i set colum in excel file as "text" or "general" but still "task-import" treat it as float(even the first row,the content is a text "a",which is not a numeric thing)

   and what is more,in the column ,in fact there is some text in the column which was treated as float.when i import them to database,the non-numeric text become null

   how to solve it?

  Thank u very much for ur kindness help



debatching in SSIS

$
0
0
Hi All,

I am a beginner to SSIS (having 8 years exp on Microsoft Platform, BizTalk Server Integrations). Need your help in understanding and coming up with a solution in SSIS
for the below 2 scenarios.

1.Splitting the files into 10k records per file (for eg if there are 65k records then there will be 7 files generated – 1 each for 10k records). File naming would be to add a sequence no at the end of the file SplitFile20141002-1608_1.csv
2.De-batching the records and sending one by one record to a Web service .(So if there are 1000 records in the source, there will be 1000 calls to the Web Service).

Could you please let me know if the above scenarios are feasible in SSIS. If yes, could you please provide some guidance on the design for the same. Would be greatly thankful, if you could point me to similar examples on the Web

Thanks and Regards,
Ujjwal

-Ujjwal

Execute batch script against SQL Servers and collect the dataset

$
0
0

Hi,

I need to execute below script against all sql servers and populate the central database.

Here is the script:

DECLARE @dt  datetime;

SET @dt = GETDATE();

SELECT @@SERVERNAME, @dt, somecolumnvalue FROM tablename

WHERE updated_date = @dt

I have created table with all sql server instance names. I created the ssis package to loop through records in the table, but don't know how to execute this script against all servers and collect the output against every server. Store the output in a central database.

Let me know if you know a way.

Thanks,

Ramu


ssis script component capture column LinageID in try catch

$
0
0

I have created a SSIS Script Component which has two outputs. Named output0 and ErrorOutput.

I have rapped the code in a TRY/CATCH block and output the exception message in the ErrorOutputBuffer.

The exception message lists the error, but does not identify which column the error occurred on.

Is this possible to do?

Mr Shaw

How to Read the one Source Column data and Display the Results

$
0
0

Hi All,

     I have one PR_ProjectType Column in my Mastertable,Based on that Column we need to reed the column data and Display the Results

Ex:

Pr_ProjectType

AD,AM

AD

AM

AD,AM,TS,CS.OT,TS

AD,AM          

like that data will come now we need 1. Ad,AM then same we need 2. AD also same we need 3. AM also we need

4.AD,AM,TS,CS.OT,TS in this string we need AD,AM  only.

this logic we need we have thousand of data in the table.Please help this is urgent issue

  


vasu


no scientific notation in csv file

$
0
0

Hi, All

I have a package is extracting data from DB to CSV file.

And I made up a column like '48484848484848484', when I load this column into CSV file,

it shows me scientific notation along with the data.

How can I get rid of the scientific notation ?

I've tried data conversion, derived column. Nothing works.

This really makes my frustrated.

Thank you in advance.

How to add a single value from another DB to new column?

$
0
0

Hi all,

I have one DB that I'm taking data out of (PostgreSQL) and I need to add a new column that has the same value for every row. The value is not constant, it is the highest value of a column in another DB (MS SQL).

Anyone with any ideas?

Cheers

Mark

SSIS package is taking more time on production server than test server

$
0
0

Same SSIS package was taking 18 hours on production and was just taking 6-7 hours on test server. When I increased the frequency of the Tlog backup file then it dropped to 11 hours. But still the difference of 3-4 hours is there.

I had doubt that production server might have online transaction causing this issues, however this was proved wrong when I shutdown production sites and then also same output.

Any idea where I am missing..


Santosh Singh

Error when using the variable System::ErrorDescription

$
0
0

HI All,

When I try to use the variable System::ErrorDescription I get the following error:

The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there.

Do I need to declare it or it's a variable that always is available to get exceptions from the execution states?

Microsoft.SqlServer.ManagedDTS not recognized in SSIS 2008

$
0
0

I recently got a new computer at work and when I open a script task in an SSIS project I get the following error:

Error 4 Reference required to assembly 'Microsoft.SqlServer.ManagedDTS, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' containing the type 'Microsoft.SqlServer.Dts.Runtime.Variables'. Add one to your project.

I never got this error before with my previous machine. i surely don't need to add a reference in every script task do I?

Thanks,

Rich

Viewing all 24688 articles
Browse latest View live


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