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

Converting rows to columns from excel using SSIS

$
0
0

Hi to all,

I have an Excel sheet , which is having the following Data , it has many rows and needs to create that rows into columns and loading data into sql server ..

i nedd to do with SSIS.

Name  Amount  Dept

a        100        sales

b        200        Sales

c        300           pro

a       200           pro

d       150          pro

e       250          man

.          .

.           .

z           450       pro

i need the out put like bellow..

 Coumns : a     b     c      d       e . . . . . . .   z

              300  200  300  150 250    . . . . .  450

Thanks & Regards,

Pavan Kumar


How to give value to field form other fields used in SSIS trasformation?

$
0
0

Hi All,

I have 36 fields(SINGLE_PREM_X, X = 1 to 36) in output file(.txt file) to create. All fields contain some numeric value. Few of them(12 fields) have to map with input fields from the table(which is already available/created) and rest of them(24 fields) I have to set 0 values in derived column in SSIS.

I have one more field name (NO_SINGLE_PREM) to get in output file and I have to set(give) this field like "This is equal to the number of array elements (SINGLE_PREM_X) filled with a value greater than 0."

Please tell me how can I get integer value for field name NO_SINGLE_PREM.

In my SSIS package, I have OLE DB source, Derived column and flat file destination set up.  

Thanks for the help in advance.


Vicky

Microsoft OLE DB for DB2 - Trailing spaces

$
0
0

We are in the process of switching from using IBM's Client Access OLE DB DASQL driver to using MIcrosoft's OLE DB for DB2 driver (part of the SQL Server feature pack).  The performance is incredible compared to the IBM driver, however, it is padding trailing spaces at the end of all char fields coming from the AS400.  I understand that on the AS400, they are padded, however, all of the OLE DB drivers I've tried over the years have automatically trimmed the char fields.  I cannot find a setting anywhere on the MS driver to do this.  I want to avoid having to do a derived column or a RTRIM in the SQL statements since there are thousands of fields.  Any help would be greatly appreciated.

SQL Server 2008 R2 Enterprise, SP 2

Microsoft OLE DB for DB2 (tried v. 3 & v. 4)

Windows Server 2008 Enterprise, SP 2


Brad Johnson

Changing characters in a character string with a derived column in SSIS

$
0
0

I have a field of nvarchar(6).  It contains date information.  The source data file is for a COBOL system.  Any date from 1/1/2000 to 12/31/2009 comes in with a leading colon.  For instance, May 5, 2000 translates to ":00505" (formatted YYMMDD).  It should be changed to "000505" by the derived column.  Any date from 1/1/2010 until 12/31/2019 comes in with a leading semicolon.  For instance, April 15, 2011 translates to ";10415" (formatted YYMMDD).  It should be changed to "110415" by the derived column.  Any date from 1/1/2020 to 12/31/2029 is going to come in with a leading "<."  For instance, June 9, 2020 translates to "<00609" (formatted YYMMDD).  It should be changed to "200609" by the derived column.  Simple procedural code should read something like this:

IF DF_DATE = ":%" THEN

    DF_DATE = "0%"

ELSE IF DF_DATE = ";%" THEN

    DF_DATE = "1%"

ELSE IF DF_DATE = "<%" THEN

    DF_DATE = "2%"

How do write this in a derived column?  I can change it easily enough if I only want to change the leading zero by using the following:

REPLACE(DF_DATE, ":", "0")

But what about the other two errant symbols?  I thought I would ask rather than skim the web for four hours.  Thank you all...far in advance.


R. J. Head


Starting a new Integration Services Project

$
0
0
How do you start a new Integration Services Project? I was told by "Introducing Microsoft SQL Server 2012 ebook" that you have to go to "File", "New" and "Project...", and a wizard would pop up. On the left toolbar, the ebook has "Business Intelligence" under "Installed Templates". However, I only have "SQL Server Management Studio Projects" and "SQL Server Management Studio Solution" under "Installed Templates". Thank you.

change variable

$
0
0

hi,

right now i am making my package locally, when i move it to another server like production, i want my variable path and conncetion should automatically change.

also i need to take my file from remote folder. i have two flat file source,also for this there will be two seperate folder in which every file will come and i want whenever that file come ,it should pick automatically ,but this folder is in remove location.

please help me

File with varying Row delimiter

$
0
0

Hi,

I have a Flat File Coming ( .csv ) ,  It sometimes come with CR + LF( carriage Return + Line feed)  as Row Delimiter & sometimes comes with only CR(carriage Return )  as row delimiter . When the Files comes in a proper format i.e. with CR+ LF as row delimiter the file is getting processed else the job executes does not fail and the File does not get processed . Is there any way to track the row delimiter  and raise an alert when the File does not come in the format needed  and does not get processed . Any help is greatly appreciated .

Thanks,

AK


shek

SSIS Package Error

$
0
0

Hello

I have gfollowing questions about the SSIS Package logs, I cannot find any logs anywhere.

ERROR message

Can any of you help with the following errors:

Package Error Events: 
ErrorCode = -1073651690
Source =
SubComponent=
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.

IDOfInterfaceWithError= {AAF6C346-C0A8-43EC-8A6D-DFC2526EC139}

Package Error Events: 
ErrorCode = -1073651690
Source =
SubComponent=
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.

IDOfInterfaceWithError= {AAF6C346-C0A8-43EC-8A6D-DFC2526EC139}

Package Error Events: 
ErrorCode = -1073651690
Source =
SubComponent=
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.

IDOfInterfaceWithError= {AAF6C346-C0A8-43EC-8A6D-DFC2526EC139}

Thanks in advance..


Importing csv with multiple values in a column to SQL table

$
0
0

Hi,

I have a csv file with the following format:

9-Jan-03SMC100;MC101;MC128CAPITAL BUILDERIFOHELMC100 0.0;MC101 0.0;MC128 0.0
1-Jan-00MB02;C02;MC04;MC23UNIVERSAL RETIREMENT PROGRAMMEPUPHILB02 13276.17;C02 13462.17;MC04 12726.15;MC23 11952.31
8-Aug-12MMC200;MC201;MC228CAPITAL BUILDER FUND
IFOGHELDMC200 0.0;MC201 0.0;MC228 0.0

I want to insert this data into SQL table in the following format:

9-Jan-03SMC100CAPITAL BUILDERIFOHELMC100 0.0
9-Jan-03SMC101CAPITAL BUILDERIFOHELMC101 0.0
9-Jan-03SMC128CAPITAL BUILDERIFOHELMC128 0.0
1-Jan-00MB02UNIVERSAL RETIREMENT PROGRAMMEPUPHILB02 13276.17
1-Jan-00MC02UNIVERSAL RETIREMENT PROGRAMMEPUPHILC02 13462.17
1-Jan-00MMC04UNIVERSAL RETIREMENT PROGRAMMEPUPHILMC04 12726.15
1-Jan-00MMC23UNIVERSAL RETIREMENT PROGRAMMEPUPHILMC23 11952.31
8-Aug-12MMC200CAPITAL BUILDER FUNDIFOGHELDMC200 0.0
8-Aug-12MMC201CAPITAL BUILDER FUNDIFOGHELDMC201 0.0
8-Aug-12MMC228CAPITAL BUILDER FUNDIFOGHELDMC228 0.0

Is there any way to do this in SSIS package?

I can do this using a Script Task and writing a code to loop through each line in the csv file. But that would be very messy.

Please suggest a simpler way to do this.

Thanks!!

How to get the meta data of the source table

$
0
0

Hi All,

I am using SSIS to check one table in SQL Server, what I want is:

1. How many rows in this table.

2. What's the data type for that table.

3. How much percentage is blank for each column's value.

Which component in SSIS can achieve it?

Thanks.

load data into a csv file with an additional column Sl No generated against each record.

$
0
0

Hi

I have data in excel source. I have to load excel data into a csv file with an additional column Sl No generated against each record.

how to generate the data for s.no automated


ShanmugaRaj

find age from date column

$
0
0

I have date of birth column DoB in Source Table.

I want to insert Age in destination Table.

Kindly provide me logic how to do this


ShanmugaRaj

audit table SSIS

$
0
0

Need to create pacakge log

1) Data Flow Task Name - System::TaskName
2) Package Name - System::PackageName
3) Executing Date - GETDATE()
4) # Input Rows - Name of the variable, that points to the Row count transformation immediately after the Source.
5) # Target Insert Rows - Name of the variable, that points to the Row count transformation immediately before the target (where data is inserted).
6) # Target Update Rows - Name of the variable, that points to the Row count transformation immediately before the target (where data is updated).
7) Load Status - Where to get this information?
8) Duration - DATEDIFF([System::ContainerStartTime] , GETDATE()]

I refered http://social.msdn.microsoft.com/Forums/en/sqlintegrationservices/thread/73ff6495-a534-4fe8-9cc1-e30c49280331

but package sample is not found..

please provide me package sample to do the task


ShanmugaRaj

Accessing data from crm web service

$
0
0

<p>Hi</p><p>I want to import data from CRM webservice.</p><p>I have created console application and referenced all XRM.Sdk bla bla</p><span style="color:#008000;font-face:Consolas;"><span style="color:#008000;font-face:Consolas;"><span style="color:#008000;font-face:Consolas;"><p>Xrm.XrmServiceContext xrm = new Xrm.XrmServiceContext(CrmConnection.Parse("Authentication Type=AD; Server=https://server:port/XRMServices/2011/Organization.svc; Username=myusername; Password=mypwd;"));</p><p><p>var coll = (from com in xrm.bc_countriesSet select com).ToList();</p></p></span></span></span><span style="font-face:Consolas;"></span>

It is working.

I want to use the same code in SSIS script task.

When I added Xrm.cs(it is generated using crmsvcutil.exe) to the solution in SSIS script task, I am getting unhandled exception. Saying problem with user code couldnot load.

Why is it?

Any other solution? Pls reply.

how to pass parameter in ado.net source

$
0
0

Hi,

i am using ado.net source in ssis to get data from cache database. I have defined two variables startdate and enddate and want to pass it using parameter into the sql query. But in ado.net source there is no parameter mapping tab. I need help to do it.

Below is my get part code.

select  distinct
convert(int,0)  as CalendarID,
d.ItemNumber                        as ProductCode,
convert(int,0)                      as ProductSK,  
Isnull(a.Customer,0)                as CustomerNumber,
convert(int,0)                      as CustomerSK,  
convert(nvarchar,a.Supplier)        as SupplierNumber,
convert(int,0)                      as SupplierSK,  
convert(nvarchar,b.Salesman1)    as SalesRepID,
convert(int,0)                      as SalesRepSK, 
isnull(i.CreatedBy,'Unknown')       as CashierID,
convert(int,0)                      as CashierSK,   
isnull(b.InvoiceNumber,'Unknown')   as TransactionNumber, -- in the source some invoice number are blank.
a.relOrderNo                        as OrderNumber, -- from order line item
a.LineItem1                         as SequenceID , 
b.Location                          as BranchID,
convert(int,0)                      as BranchSK,   
$$^WWWDATE(b.OrderDate)             as InvoiceDateGr,
convert(int,0)                      as PaymentMethodSK,   
isnull(b.Zahlungsweg,'Unknown')     as PaymentMethodID,
isnull(a.UnitSalesPrice,0)          as SellingPrice,
isnull(a.UnitSalesPrice,0)          as SellingPriceUsed, 
isnull(a.Cost,0)                    as CostPrice,
isnull(a.AdditionDiscount1,0)       as DiscountAmount,

case 
    when a.ComplaintSparePart = 0       then a.Quantity
    when a.ComplaintSparePart is null   then a.quantity-- if Complaintsparepart is 0 and is null then sales
    else 0 end as SalesQuantity,

case 
    when a.ComplaintSparePart = 0 then a.NetSalesPrice
    when a.ComplaintSparePart is null then a.NetSalesPrice -- if Complaintsparepart is 0 and is null then sales
    else 0 end     as SalesValue,

isnull(a.Remarks,0)                 as SellingPackSize,
isnull(a.QuantityUnit,0)            as UOS,
P.Consistof                         as PackID, -- in the source system all are null
convert(nvarchar,d.createdby)  as BuyerID,
convert(int,0)                      as BuyerSK, 

case 
    when a.ComplaintSparePart = 1 
    then a.Quantity  else 0 end     as ReturnQuantity , -- if Complaintsparepart is 1 then Return quantity

case
    when a.ComplaintSparePart = 1 
    then a.NetSalesPrice else 0 end as ReturnValue, --if Complaintsparepart is 1 then Return value
             
b.OrderType                         as IdentifierID, -- 0 is customer order update it from ordertype dimension
convert(int,0)                      as IdentifierSK, 
isnull(a.ComplaintReason,'Unknown') as ReturnReasonCode,
convert(int,0)                      as ReturnReasonSK,
a.datecreated                       as DateCreated

from user.INAUFP  a
left outer join  user.INAUF  b
    on a.relOrderNo = b.OrderNo
left outer join user.INKUNDE c
    on a.Customer = c.CustomerNumber
left outer join user.INART d
    on a.itemnumber = d.itemnumber
left outer join User.InARTPACK p
   on d.ItemNumber = p.ItemNumber
left outer join user.infibcashiercare i
    on a.customer = i.CustomerNumber
where a.invoicenumber<>0and a.datecreated >= ?
and a.datecreated >= ?


SSIS script for checking data and data quality

$
0
0

Hi,

 

If someone do the initial load and incremental load into a dimension table or a fact table, after that i have to create and execute the script. 

1. to check the data, whether it is matching or not.

2. check the data quality.

and I want to do something dynamically ( can be anything ) not manually checking of thousand of data (rows).

Any help would be appreciated

Thanks

condition split

$
0
0

one of my column has blank values in flat file.

i want in condition split,that value,

i am giving condition , isnull(columnname)

but its not working

moving file from ftp local folder

$
0
0

hi,

i have sftp server ,from where i need to move all the files to my local folder . and then need to process

SSIS 2008 SP1 - The file name specified in the connection was not valid AND package continues to run anyway successfully

$
0
0

Hello,
I have an SSIS package that loads a tablefrom a file.
With SSIS 2008 R2 SP1when the package can not find thefile, I receive an error message
The file name specified in the connection was not valid. but the package continues to run anyway successfully.


We install SP3 andthen the package
FAIL when can not find the file with  the sameerror message .


Question : do you have any idea why it continues
successfully under SP1despitethe error message

THX




" Multiple-step OLE DB operation generated errors" while executing a Oracle Stored Procedure from SSIS .

$
0
0

I am using SQL Server 2008 R2  Standard Edition .I am using Oracle OLE DB Driver to connect to Oracle database 10gr2.

I have a SSIS package that

a) executes SQL Task  (  to execute Oracle Stored Procedure ) . Note : I am connecting to Oracle 10g R2

b) execute SQL Task ( to execute SQL Server Stored Procedure )

c) executes SQL Task  (  to execute Oracle Stored Procedure ) . Note : I am connecting to Oracle 10g R2

In both steps a & b , I am getting following error / warning message . And step 2 is  skipped.

Warning: 0x0 at "Running" process control: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

Warning: 0x0 at "Running" process control: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

Thanks for looking into this.

Viewing all 24688 articles
Browse latest View live


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